/// <summary> /// Draw code of the program /// </summary> private void Draw() { window.Clear(); Score.Draw(window); if (gameState == GameState.Ready) { window.Draw(readyText); } if (gameState == GameState.Lose) { window.Draw(gameOverText); } grid.Draw(window); pacman.Draw(window); blinky.Draw(window); inky.Draw(window); pinky.Draw(window); clyde.Draw(window); window.Display(); }
public void DrawAll() { for (int y = 0; y < MapObject.GetLength(1); y++) { for (int x = 0; x < MapObject.GetLength(0); x++) { if (MapObject[x, y] is Wall) { Console.ForegroundColor = ((Wall)MapObject[x, y]).Color; Console.Write(((Wall)MapObject[x, y]).Symbol); Console.ResetColor(); } else if (MapObject[x, y] is Enemy) { Console.ForegroundColor = ((Enemy)MapObject[x, y]).Color; Console.Write(((Enemy)MapObject[x, y]).Symbol); Console.ResetColor(); } else if (MapObject[x, y] is Player) { Console.ForegroundColor = ((Player)MapObject[x, y]).Color; Console.Write(((Player)MapObject[x, y]).Symbol); Console.ResetColor(); } else if (MapObject[x, y] is Money) { Console.ForegroundColor = ((Money)MapObject[x, y]).Color; Console.Write(((Money)MapObject[x, y]).Symbol); Console.ResetColor(); } else { Console.Write(' '); } } Console.WriteLine(); } Score.Draw(); }