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.

72 lines
2.7 KiB

  1. using Microsoft.Xna.Framework.Content;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using System.Collections.Generic;
  4. namespace SemiColinGames {
  5. public 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. public static class Textures {
  23. public static SpriteFont DebugFont;
  24. public static SpriteFont BannerFont;
  25. // Character spritesheets.
  26. public static TextureRef Executioner = new TextureRef("sprites/ccg/executioner_female");
  27. public static TextureRef Ninja = new TextureRef("sprites/ccg/ninja_female");
  28. // UI sprites.
  29. public static TextureRef Heart = new TextureRef("sprites/semicolin/heart");
  30. // Ship sprites.
  31. public static TextureRef SilverBlue1 = new TextureRef("sprites/dylestorm/SilverBlue-1");
  32. // Backgrounds are indexed by draw order; the first element should be drawn furthest back.
  33. public static TextureRef[] Backgrounds = new TextureRef[] {
  34. new TextureRef("backgrounds/szadiart/pf4/background1_day"),
  35. new TextureRef("backgrounds/szadiart/pf4/background2a_day"),
  36. new TextureRef("backgrounds/szadiart/pf4/background3_day"),
  37. new TextureRef("backgrounds/szadiart/pf4/background4_day"),
  38. };
  39. // Background tiles.
  40. public static TextureRef Cemetery = new TextureRef("tiles/anokolisa/cemetery");
  41. public static TextureRef Crypt = new TextureRef("tiles/anokolisa/crypt");
  42. public static TextureRef Dungeon = new TextureRef("tiles/anokolisa/dungeon");
  43. public static TextureRef Forest = new TextureRef("tiles/anokolisa/forest");
  44. public static TextureRef Garden = new TextureRef("tiles/anokolisa/garden");
  45. public static TextureRef Grassland = new TextureRef("tiles/anokolisa/grassland");
  46. public static TextureRef Ruins = new TextureRef("tiles/anokolisa/ruins");
  47. public static TextureRef Sewer = new TextureRef("tiles/anokolisa/sewer");
  48. public static TextureRef Temple = new TextureRef("tiles/anokolisa/temple");
  49. public static TextureRef Village = new TextureRef("tiles/anokolisa/village");
  50. public static void Load(ContentManager content) {
  51. DebugFont = content.Load<SpriteFont>("fonts/debug");
  52. BannerFont = content.Load<SpriteFont>("fonts/banner");
  53. TextureRef.LoadAll(content);
  54. }
  55. }
  56. }