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]; } }
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); } } }
public void SetTile(int x, int y, int id, float rotation = 0f) { map[y][x] = new TileEntry(id, rotation); }