public void RenderLivesBonus(Graphics g, int lives) { var lifeSprite = _sprites.PacMan(Direction.Left, 1, false); // The large sprite in the score board span two grid squares // rather than being central to one. Adding 0.5 grid square to compensate var ypos = Sprites.PixelGrid / 2; for (int i = 0; i < lives; i++) { _sprites.RenderSprite(g, (i * Sprites.PixelGrid * 2) + 2 * Sprites.PixelGrid + Sprites.PixelGrid / 2, ypos, lifeSprite); } }
public void RenderWalls(Graphics g, NPacMan.Game.Game game) { _mapLayout.UpdateFromGame(game); var cellSize = Sprites.PixelGrid; for (int y = 0; y < _mapLayout.DisplayHeight; y++) { for (int x = 0; x < _mapLayout.DisplayWidth; x++) { var posX = x * cellSize; var posY = y * cellSize; _sprites.RenderSprite(g, posX, posY, _sprites.Map(_mapLayout.BoardPieceToDisplay(x, y))); } } }