Exemple #1
0
 public Layer(int width, int height, bool isCollision)
 {
     this.isCollision = isCollision;
     map = new TileEntry[height][];
     for (int i = 0; i < map.Length; i++)
     {
         map[i] = new TileEntry[width];
     }
 }
Exemple #2
0
 public void Draw(SpriteBatch spriteBatch)
 {
     for (int y = 0; y < map.Length; y++)
     {
         for (int x = 0; x < map[y].Length; x++)
         {
             TileEntry tile = map[y][x];
             Tile.Tiles[tile.ID].Draw(spriteBatch, new Vector2(x * Globals.TILE_SIZE, y * Globals.TILE_SIZE), Globals.DRAW_TILE, tile.Rotation);
         }
     }
 }
Exemple #3
0
 public void SetTile(int x, int y, int id, float rotation = 0f)
 {
     map[y][x] = new TileEntry(id, rotation);
 }