コード例 #1
0
 //Some inits are within the game constructor
 public Game1()
 {
     tileTextures          = new TileTextures();
     graphics              = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     graphics.PreferredBackBufferHeight = 700;
     graphics.PreferredBackBufferWidth  = 700;
 }
コード例 #2
0
ファイル: GameContent.cs プロジェクト: yatesm4/citysim_game
        // load tile/tileset textures
        public void LoadTileTextures()
        {
            // Load Tile Effect Textures within negative range
            TileTextures.Add(new ContentData <Texture2D>(-1, "Sprites/Tiles/FX/Smoke/01-Anim", _content));

            // total: 12
            var i = 1;

            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Grass", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Dirt", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Cement", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Water", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Stone", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Coal", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Iron", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Tree_Single_01", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Natural/Tree_Cluster_01", _content));

            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/TownHall/01", _content));              // 10
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/01", _content));                 // 11
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Farm/01", _content));                  // 12
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Farm/02", _content));                  // 13
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Wood/01", _content));                  // 14
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Ore/01", _content));                   // 15
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Power/01", _content));                 // 16
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Power/02", _content));                 // 17

            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/02", _content));                 // 18
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/03", _content));                 // 19
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/04", _content));                 // 20
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/05", _content));                 // 21
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/06", _content));                 // 22
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/07", _content));                 // 23
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/08", _content));                 // 24
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/House/09", _content));                 // 25

            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/Left", _content));               // 26
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/Right", _content));              // 27
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/4_Way_Intersection", _content)); // 28
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/T_Intersection_1", _content));   // 29
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/T_Intersection_2", _content));   // 30
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/T_Intersection_3", _content));   // 31
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/T_Intersection_4", _content));   // 32
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/Corner_1", _content));           // 33
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/Corner_2", _content));           // 34
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/Corner_3", _content));           // 35
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Roads/Corner_4", _content));           // 36

            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Watermill/01", _content));             // 37
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Tiles/Buildings/Watermill/01-Anim", _content));        // 38

            Console.WriteLine($"Tile Textures: {i}");
        }
コード例 #3
0
        // load tile/tileset textures
        public void LoadTileTextures()
        {
            // total: 12
            var i = 1;

            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Glow", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Grass", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Tree", _content)
            {
                TypeId = 1
            });
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Road", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Cement", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Grass_Bench", _content)
            {
                TypeId = 1
            });
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Road_Left", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Ground_Road_Right", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_01", _content)
            {
                TypeId = 1
            });
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_01_Floor", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_02", _content)
            {
                TypeId = 1
            });
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_03", _content)
            {
                TypeId = 1
            });
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_N", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_S", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_E", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_W", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_NE", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_NW", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_SE", _content));
            TileTextures.Add(new ContentData <Texture2D>(i++, "Sprites/Environment/Structures/Room_00_Wall_SW", _content));

            Console.WriteLine($"Tile Textures: {i}");
        }