Exemplo n.º 1
0
        private void GhostAnimationCoplete(AbstractGhost ghost, double time)
        {
            if (_pathIndex == 0)//ExitPoint
            {
                return;
            }
            var pacman = PacmanPosition?.Invoke(ghost);

            if (ghost.Path == null)
            {
                ghost.Dispose();
                GC.Collect();
            }
            if (_pathIndex < ghost.Path.Count)
            {
                MoveGost(ghost, ghost.Speed);
            }
            else
            {
                ghost.Behavior.Think(ghost, pacman);
                _pathIndex = 1;
                PointAnimationHelperNotify?.Invoke(ghost);
            }
        }
Exemplo n.º 2
0
 public Actions()
 {
     currentPosition = new PacmanPosition();
 }