Beispiel #1
0
 public Ghost(Game game)
     : base(game)
 {
     // TODO: Construct any child components here
     this.pacMan = ((Game1)game).pacMan;
     //pacMan.Attach(this);
     gameConsole     = (GameConsole)game.Services.GetService(typeof(IGameConsole));
     strGhostTexture = "RedGhost";
     this.ghostState = GhostState.Roving;
     Ghost.Ghosts.Add(this);
     r = new Random();
 }
Beispiel #2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            //Game Services
            input   = new InputHandler(this);
            console = new GameConsole(this);
            this.Components.Add(input);
            this.Components.Add(console);

            pacMan = new PacMan(this);
            this.Components.Add(pacMan);

            ghostMan = new GhostManager(this);
            this.Components.Add(ghostMan);
        }