public void AddSubTile(SubTile subTile, int i, int j) { Tile tile = TileGrid[i, j]; tile.TryAddSubtile(subTile); ImportantTiles.Add(tile); UpdateWorldRender(); }
public void TryAddSubtile(SubTile subTile) { for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (GetSubTileBounds(i, j).Contains(InputManager.MouseScreenPosition)) { SubTiles[i, j] = subTile; return; } } } }
public void Draw(SpriteBatch spriteBatch, Vector2 position) { spriteBatch.Draw(Texture, position, Color.White); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { SubTile subTile = SubTiles[i, j]; if (subTile != null) { subTile.Draw(spriteBatch, position + new Vector2(i * SubTile.WIDTH, j * SubTile.HEIGHT)); } } } }
protected Tile(Texture2D texture, TileCoordinates coords) { Texture = texture; Coordinates = coords; SubTiles = new SubTile[2, 2]; }