public void reset(int stage) { this.stage = stage; board.ClearPacMan(pacman.Point); wallList = PointLists.mapList(stage, '0'); switch (stage) { case 1: pacman = new Pacman(new Point(26, 39), Direction.STOP); break; case 2: pacman = new Pacman(new Point(26, 45), Direction.STOP); break; default: break; } pacmanNextDirection = Direction.STOP; }
private void runPacman() { while (State != GameState.GAMEOVER) { try { this.Point = pacman.Point; board.ClearPacMan(pacman.Point); pacman = pacmanMove(pacman.Point, pacmanDirection); board.DrawPacMan(pacman.Point, Color.Yellow, pacman.Direction); PacmanRunner.Wait(_delay); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }