public void ResetLevel() { _GameStopped = false; _Pacman._PermissableDirection = new int[] { 0, 0, 1, 1, 0 }; _Pacman.Move2StartPosi(); _Pacman.Start(); _Pacman._Alive = true; // pacman is alive foreach (Ghost g in _Ghosts) // move characters to start posi's { g.Move2StartPosi(); } _Pacman._Direction = 'L'; // set pacman off and running... _Blinky._Direction = (Convert.ToBoolean(SplashKit.Rnd(0, 1)))? 'L': 'R'; // set pacman off and running... _Pinky.StartGhost(5); _Inky.StartGhost(5); _Clyde.StartGhost(5); SplashKit.ResumeMusic(); // resume siren :) }
public void InitiateGame() { processColision = false; GameOver = false; Pacman.Start(pacmanPosition); Blinky.Start(positionInFrontOfPrision); Pinky.Start(positionInsideOfPrision); Inky.Start(positionInsideOfPrision + Vector.LEFT * 2); Clyde.Start(positionInsideOfPrision + Vector.RIGHT * 2); WaitAndCall((int)TIME_TO_RELEASE_GHOSTS * 1000, Pinky.Unlock); WaitAndCall((int)TIME_TO_RELEASE_GHOSTS * 1000 * 2, Inky.Unlock); WaitAndCall((int)TIME_TO_RELEASE_GHOSTS * 1000 * 3, Clyde.Unlock); WaitAndCall((int)TIME_TO_DROP_XP_ITEM * 1000, DropXpItem); }