public void Draw(SpriteBatch spriteBatch, IsometricTile tile) { int yOff = 32; // how much to displace actor up from tile (may not want this to be uniform... foreach (int ID in tile.ActorList) { SpriteClass actor = new SpriteClass(tile.X, tile.Y - (yOff * scale), scale); if (ID == TURTLE) { actor.texture = turtle; } if (ID == TURTLEGANG) { actor.texture = turtleGang; } if (ID == BADGER) { actor.texture = badger; } // TODO try/catch for null texture, cause that can totally happen if ID is invalid actor.Draw(spriteBatch); } }
public void Draw(SpriteBatch spriteBatch, IsometricTile tile) { if (tile.TextureID == GRASS) { grass.Draw(spriteBatch); } }
public void DrawTiles(SpriteBatch spriteBatch) { for (int y = 0; y < yLength; y++) { for (int x = 0; x < xLength; x++) { IsometricTile curr = tileMap[x, y, 0]; if (curr.TextureID == 1) { grass.X = curr.X; grass.Y = curr.Y; grass.Draw(spriteBatch); } } } }