コード例 #1
0
        public World(int W = 20, int H = 20)
        {
            Tiles  = new Tile[W, H];
            this.W = W;
            this.H = H;

            Tile Bottom = new Tile(TileMgr.GetTileTex(1), false);
            Tile Wall   = new Tile(TileMgr.GetTileTex(2), true);

            for (int x = 0; x < W; x++)
            {
                for (int y = 0; y < H; y++)
                {
                    Tiles[x, y] = Bottom;
                }
            }

            Tiles[5, 3] = Tiles[5, 4] = Tiles[5, 5] = Tiles[5, 6] = Tiles[5, 7] = Wall;
            Tiles[6, 3] = Tiles[7, 3] = Tiles[8, 3] = Wall;
            Tiles[6, 7] = Tiles[7, 7] = Tiles[8, 7] = Wall;
        }
コード例 #2
0
ファイル: Tile.cs プロジェクト: DDHustle/TheGame
 /// <summary>
 ///
 /// </summary>
 static Tile()
 {
     T = new Sprite(TileMgr.GetTileTex(0));
 }