Beispiel #1
0
 private void ResolveCollision(AbstractGhostCharacter ghost)
 {
     if (ghost.State == AbstractGhostCharacter.GhostState.FRIGHTENED)
     {
         ghost.Eaten();
     }
     else
     {
         EndGame();
     }
 }
Beispiel #2
0
        private void CheckGhostCollision(AbstractGhostCharacter ghost)
        {
            if (ghost.State == AbstractGhostCharacter.GhostState.EATEN)
            {
                return;
            }

            if (Pacman.Position.Equals(ghost.Position))
            {
                ResolveCollision(ghost);
            }
        }