public GhostAIController(MyGame g, Ghost player, IControllable target)
     : base(g)
 {
     this.Target = target;
     this.Ghost = player;
     this.Ghost.ReadyToMove += Ghost_ReadyToMove;
     this.Ghost.Behavior.StateChanged += GhostBehavior_StateChanged;
 }
Beispiel #2
0
        private void RegisterNewGhost(String ghostType, Puckman p, MazeSection r1, MazeSection r2)
        {
            Ghost g1 = new Ghost(this.Game as MyGame, ghostType);
            g1.Region = Tuple.Create(r1, r2);
            g1.CurrentLocation = this.Maze.GetGhostLairSection();
            g1.Initialize();

            this.Components.Add(g1);

            GhostAIController iaCtrl1 = new GhostAIController(this.Game as MyGame, g1, p);
            iaCtrl1.Initialize();

            this.Components.Add(iaCtrl1);
        }