A stealth-based 2D platformer where you don't have to kill anyone unless you want to. https://www.semicolin.games
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.3 KiB

  1. using Microsoft.Xna.Framework.Content;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using System.Collections.Generic;
  4. namespace SemiColinGames {
  5. class TextureRef {
  6. private static readonly List<TextureRef> allTextures = new List<TextureRef>();
  7. public static void LoadAll(ContentManager content) {
  8. foreach (TextureRef texture in allTextures) {
  9. texture.Load(content);
  10. }
  11. }
  12. private readonly string contentPath;
  13. public TextureRef(string contentPath) {
  14. allTextures.Add(this);
  15. this.contentPath = contentPath;
  16. }
  17. public Texture2D Get { get; private set; }
  18. private void Load(ContentManager content) {
  19. Get = content.Load<Texture2D>(contentPath);
  20. }
  21. }
  22. class Textures {
  23. public static SpriteFont DebugFont;
  24. public static SpriteFont BannerFont;
  25. public static TextureRef Player = new TextureRef("sprites/ccg/ninja_female");
  26. // Backgrounds are indexed by draw order; the first element should be drawn furthest back.
  27. public static TextureRef[] Backgrounds = new TextureRef[] {
  28. new TextureRef("backgrounds/szadiart/pf4/background1_day"),
  29. new TextureRef("backgrounds/szadiart/pf4/background2a_day"),
  30. new TextureRef("backgrounds/szadiart/pf4/background3_day"),
  31. new TextureRef("backgrounds/szadiart/pf4/background4_day"),
  32. };
  33. public static TextureRef Cemetery = new TextureRef("tiles/anokolisa/cemetery");
  34. public static TextureRef Crypt = new TextureRef("tiles/anokolisa/crypt");
  35. public static TextureRef Dungeon = new TextureRef("tiles/anokolisa/dungeon");
  36. public static TextureRef Forest = new TextureRef("tiles/anokolisa/forest");
  37. public static TextureRef Garden = new TextureRef("tiles/anokolisa/garden");
  38. public static TextureRef Grassland = new TextureRef("tiles/anokolisa/grassland");
  39. public static TextureRef Ruins = new TextureRef("tiles/anokolisa/ruins");
  40. public static TextureRef Sewer = new TextureRef("tiles/anokolisa/sewer");
  41. public static TextureRef Temple = new TextureRef("tiles/anokolisa/temple");
  42. public static TextureRef Village = new TextureRef("tiles/anokolisa/village");
  43. public static void Load(ContentManager content) {
  44. DebugFont = content.Load<SpriteFont>("fonts/debug");
  45. BannerFont = content.Load<SpriteFont>("fonts/banner");
  46. TextureRef.LoadAll(content);
  47. }
  48. }
  49. }