예제 #1
0
파일: Program.cs 프로젝트: equadon/pacmandx
 static void Main(string[] args)
 {
     using (var game = new PacmanGame())
     {
         game.Run();
     }
 }
예제 #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (PacmanGame game = new PacmanGame())
     {
         game.Run();
     }
 }
예제 #3
0
파일: Class1.cs 프로젝트: joram/Gadgeteer
        public void Main(string ApplicationPath, string[] Args)
        {
            Form frmPacman = new Form("frmPacman");
            frmPacman.ButtonPressed += frmPacman_ButtonPressed;

            Bitmap bmpGame;
            Picturebox pbGame;

            bmpGame = new Bitmap(320, 240);

            if (Prompt.Show("Resolution Adjust", "Would you like to play at 640x480?", Fonts.Calibri18Bold, Fonts.Calibri14, PromptType.YesNo) == PromptResult.Yes)
            {
                pbGame = new Picturebox("pbGame", bmpGame, frmPacman.Width / 2 - 320, frmPacman.Height / 2 - 240, 640, 480, BorderStyle.BorderNone);
                pbGame.ScaleMode = ScaleMode.Stretch;
            }
            else
                pbGame = new Picturebox("pbGame", bmpGame, frmPacman.Width / 2 - 160, frmPacman.Height / 2 - 140, BorderStyle.BorderNone);

            pbGame.Background = Colors.Black;
            game = new PacmanGame(bmpGame, pbGame);
            frmPacman.AddControl(pbGame);

            Graphics.ActiveContainer = frmPacman;

            Thread.Sleep(100);
            if (joystick != null)
            {
                game.InputManager.AddInputProvider(joystick);
                game.Initialize();
            }
        }
예제 #4
0
파일: Program.cs 프로젝트: pjdevs/pacman
 static void Main(string[] args) // Fonction d'entrée du programme
 {
     // On décare le jeu et on le lance
     using (PacmanGame game = new PacmanGame())
     {
         game.Run();
     }
 }
예제 #5
0
 public PacmanGame()
 {
   this.graphics = new GraphicsDeviceManager((Game) this);
   this.Content.RootDirectory = "Content";
   PacmanGame.PacmanGame1 = this;
   this.graphics.PreferredBackBufferWidth = 448;
   this.graphics.PreferredBackBufferHeight = 576;
   this.graphics.ApplyChanges();
   PacmanGame.Background = new Background();
   PacmanGame.Map = new Map();
   PacmanGame.Intro = new Intro();
 }
예제 #6
0
        static void Main(string[] args)
        {
            var     map        = Map.CreateASampleMap();
            var     pacman     = new Pacman(Direction.North, 1, 0);
            var     monster1   = new Monster(2, 2);
            var     monster2   = new Monster(1, 2);
            var     presenter  = new Presenter(new ConsoleIo());
            var     randomiser = new Randomiser();
            var     io         = new ConsoleIo();
            IPlayer player     = new ConsolePlayer(io);
            IPlayer aiPlayer   = new AIPlayer(randomiser);
            IPlayer aiPlayer1  = new AIPlayer(randomiser);
            var     playerList = new Dictionary <IPlayer, ICharacter>
            {
                { player, pacman },
                { aiPlayer, monster1 },
                { aiPlayer1, monster2 }
            };

            var game = new PacmanGame(playerList, map, presenter);

            game.Run();
        }
예제 #7
0
 static void Main()
 {
     PacmanGame game = new PacmanGame();
     game.Run();
 }
예제 #8
0
파일: Ghost.cs 프로젝트: ianlee74/Gadgetab
        public Ghost(Bitmap spriteSheet, Maze maze, Player player, int spriteSheetYOffset, Personality personality)
            : base(maze)
        {
            _game = (PacmanGame)GameManager.Game;

              Player = player;
              _personality = personality;

              // NB: The sequence of the animations must match the
              //     "Animation Selection Constants" defined above
              SetAnimationSequences(new AnimationSequence[]
              {
            // 0 - Left
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(0, spriteSheetYOffset, 16, 16),
              new Rect(16, spriteSheetYOffset, 16, 16),
            }),
            // 1 - Right
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(32, spriteSheetYOffset, 16, 16),
              new Rect(48, spriteSheetYOffset, 16, 16),
            }),
            // 2 - Up
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(64, spriteSheetYOffset, 16, 16),
              new Rect(80, spriteSheetYOffset, 16, 16),
            }),
            // 3 - Down
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(96, spriteSheetYOffset, 16, 16),
              new Rect(112, spriteSheetYOffset, 16, 16),
            }),

            // 4 - Frightened
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(128, 16, 16, 16),
              new Rect(144, 16, 16, 16),
            }),

            // 5 - Recovering
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(128, 16, 16, 16),
              new Rect(128, 32, 16, 16),
              new Rect(144, 16, 16, 16),
              new Rect(144, 32, 16, 16),
            }),
            // 6 - Left Dead
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(128, 48, 16, 16),
            }),
            // 7 - Right Dead
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(144, 48, 16, 16),
            }),
            // 8 - Up Dead
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(128, 64, 16, 16),
            }),
            // 9 - Down Dead
            new AnimationSequence(spriteSheet, 6, new Rect[]
            {
              new Rect(144, 64, 16, 16),
            }),
              });

              Reset();

              MessageService.Instance.Subscribe(typeof(Messages.AtePowerPillMessage), HandleAtePowerPillMessage);
              MessageService.Instance.Subscribe(typeof(Messages.PacmanDyingMessage), HandlePacmanDyingMessage);
              MessageService.Instance.Subscribe(typeof(Messages.PacmanDeadMessage), HandlePacmanDeadMessage);

              _stateCountDown.Expired += StateCountDown_Expired;
        }
예제 #9
0
        static void Main()
        {
            PacmanGame game = new PacmanGame();

            game.Run();
        }
예제 #10
0
        static void Main(string[] args)
        {
            PacmanGame game = new PacmanGame();

            game.Run();
        }
예제 #11
0
        private void ZombieDistractorForm()
        {
            const int gameWidth = 320;
            const int gameHeight = 240;

            var frm = new Form("zombie distractor");

            // Add panel
            var pnl = new Skewworks.Tinkr.Controls.Panel("pnl1", 0, 0, 800, 480);
            pnl.BackgroundImage = Resources.GetBitmap(Resources.BitmapResources.Zombies);
            frm.AddControl(pnl);

            // Add the app bar.
            pnl.AddControl(BuildAppBar(frm.Name));

            // Add a title.
            var title = new Label("lblTitle", "Zombie Distractor", _fntHuge, frm.Width / 2 - 140, 30) { Color = Gadgeteer.Color.Yellow };
            pnl.AddControl(title);

            TinkrCore.ActiveContainer = frm;

            // Add Pacman.
            var surface = TinkrCore.Screen;
            _pacmanGame = new PacmanGame(surface, frm.Width/2 - gameWidth/2, frm.Height/2 - gameHeight/2);
            _pacmanGame.InputManager.AddInputProvider(new GhiJoystickInputProvider(joystick));
            _pacmanGame.Initialize();
        }
예제 #12
0
        private void OnAppMenuSelected(object sender, int menuid, string menutext)
        {
            if (_pacmanGame != null)
            {
                _pacmanGame.Enabled = false;
                _pacmanGame.Stop();
                _pacmanGame = null;
            }

            switch (menutext)
            {
                case "zombie cannon remote":
                    //ZombieCannonRemoteForm();
                    AuthenticationForm();
                    break;
                case "zombie twit":
                    ZombieTwitForm();
                    break;
                case "zombie distractor":
                    ZombieDistractorForm();
                    break;
                case "zombie health monitor":
                    ZombieHealthMonitorForm();
                    break;
            }
        }