コード例 #1
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 /// Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     game.gameState = DespicableGame.GameState.menu;
 }
コード例 #2
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 /// Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     minion.PrepareMovement(minion.actualTile.TopTile, 0, -DespicableGame.SPEED);
 }
コード例 #3
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 /// Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     game.CreateProjectile();
 }
コード例 #4
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 /// Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     minion.PrepareMovement(minion.actualTile.RightTile, DespicableGame.SPEED, 0);
 }
コード例 #5
0
 public void Execute(Gamepad pad)
 {
     game.PauseButtonPressAction();
 }
コード例 #6
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 /// Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     gru.VerifyMovement(gru.actualTile.RightTile, DespicableGame.SPEED, 0);
 }
コード例 #7
0
 public void Execute(Gamepad pad)
 {
 }
コード例 #8
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 /// Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     gru.VerifyMovement(gru.actualTile.BotomTile, 0, DespicableGame.SPEED);
 }
コード例 #9
0
 public void Execute(Gamepad pad)
 {
     player.Down();
 }
コード例 #10
0
 public void Execute(Gamepad pad)
 {
     player.Up();
 }
コード例 #11
0
 public void Execute(Gamepad pad)
 {
     player.UnleashMinions();
 }
コード例 #12
0
 public void Execute(Gamepad pad)
 {
     player.Right();
 }
コード例 #13
0
 public void Execute(Gamepad pad)
 {
     player.ActivatePowerup();
 }
コード例 #14
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 ///Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     game.Pausing();
 }
コード例 #15
0
 public void Execute(Gamepad pad)
 {
     game.Exit();
 }
コード例 #16
0
ファイル: Commands.cs プロジェクト: mangaalex95/TP2_POO
 /// <summary>
 /// Executes the specified command.
 /// </summary>
 /// <param name="gamepad">The gamepad.</param>
 public void Execute(Gamepad gamepad)
 {
     game.CreateMinions();
 }
コード例 #17
0
 public void Execute(Gamepad pad)
 {
     player.Left();
 }
コード例 #18
0
ファイル: DespicableGame.cs プロジェクト: mangaalex95/TP2_POO
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            gameState = GameState.menu;

            horizontalWall = Content.Load<Texture2D>(GameGraphics.HWALL);
            verticalWall = Content.Load<Texture2D>(GameGraphics.VWALL);
            textFont = Content.Load<SpriteFont>("Fonts/gamefont");

            // TODO: use this.Content to load your game content here
            Gru = new PlayableCharacter
                    (
                    Content.Load<Texture2D>(GameGraphics.GRU),
                    new Vector2(labyrinth.GetTile(START_X, START_Y).GetPosition().X, labyrinth.GetTile(START_X, START_Y).GetPosition().Y),
                    labyrinth.GetTile(START_X, START_Y)
                    );

            ship = new ExitShip(Content.Load<Texture2D>(GameGraphics.SHIP), labyrinth.GetRandomTile());

            policeList = new List<Police>();

            //L'entrée du téléporteur
            warpEntrance = Content.Load<Texture2D>(GameGraphics.WARP1);
            warpEntrancePos = new Vector2(labyrinth.GetTile(7, 4).GetPosition().X - Tile.TAILLE_LIGNE, labyrinth.GetTile(7, 4).GetPosition().Y + Tile.TAILLE_LIGNE);

            //Les sorties du téléporteur
            for (int i = 0; i < warpExit.Length; i++)
            {
                warpExit[i] = Content.Load<Texture2D>(GameGraphics.WARP2);
            }

            warpExitPos[0] = new Vector2(labyrinth.GetTile(0, 0).GetPosition().X, labyrinth.GetTile(0, 0).GetPosition().Y);
            warpExitPos[1] = new Vector2(labyrinth.GetTile(Labyrinth.WIDTH - 1, 0).GetPosition().X, labyrinth.GetTile(Labyrinth.WIDTH - 1, 0).GetPosition().Y);
            warpExitPos[2] = new Vector2(labyrinth.GetTile(0, Labyrinth.HEIGHT - 1).GetPosition().X, labyrinth.GetTile(0, Labyrinth.HEIGHT - 1).GetPosition().Y);
            warpExitPos[3] = new Vector2(labyrinth.GetTile(Labyrinth.WIDTH - 1, Labyrinth.HEIGHT - 1).GetPosition().X, labyrinth.GetTile(Labyrinth.WIDTH - 1, Labyrinth.HEIGHT - 1).GetPosition().Y);

            labyrinth.SpawnMoney(Content.Load<Texture2D>(GameGraphics.MONEY));

            currentPowerUp = CreateNewPowerUP();
            projectilesList = new List<Projectile>();

            gamepad = new Gamepad();
            gamepad.RegisterCommand(Buttons.DPadUp, new GruMoveUp(Gru));
            gamepad.RegisterCommand(Buttons.DPadDown, new GruMoveDown(Gru));
            gamepad.RegisterCommand(Buttons.DPadLeft, new GruMoveLeft(Gru));
            gamepad.RegisterCommand(Buttons.DPadRight, new GruMoveRight(Gru));
            gamepad.RegisterCommand(Buttons.LeftShoulder, new SpawnMinions(this));
            gamepad.RegisterCommand(Buttons.RightShoulder, new GruShoot(this));
            gamepad.RegisterCommand(Buttons.Back, new BackToMenu(this));
            gamepad.RegisterCommand(Buttons.Start, new PauseGame(this));
        }
コード例 #19
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            gameTextures[(int)GameTextures.HORIZONTAL_WALL] = Content.Load<Texture2D>("Sprites\\Hwall");
            gameTextures[(int)GameTextures.VERTICAL_WALL] = Content.Load<Texture2D>("Sprites\\Vwall");
            gameTextures[(int)GameTextures.POLICE_OFFICER] = Content.Load<Texture2D>("Sprites\\Police");
            gameTextures[(int)GameTextures.GRU] = Content.Load<Texture2D>("Sprites\\Gru");
            gameTextures[(int)GameTextures.GOAL] = Content.Load<Texture2D>("Sprites\\Dollar");
            gameTextures[(int)GameTextures.WARP_ENTRANCE] = Content.Load<Texture2D>("Sprites\\Warp1");
            gameTextures[(int)GameTextures.WARP_EXIT] = Content.Load<Texture2D>("Sprites\\Warp2");
            gameTextures[(int)GameTextures.LEVEL_EXIT] = Content.Load<Texture2D>("Sprites\\SpaceShip");
            gameTextures[(int)GameTextures.TRAP] = Content.Load<Texture2D>("Sprites\\Trap");
            gameTextures[(int)GameTextures.SPEEDBOOST] = Content.Load<Texture2D>("Sprites\\Speedboost");
            gameTextures[(int)GameTextures.POWERUP_IN_STORE] = Content.Load<Texture2D>("Sprites\\PowerupInStore");
            gameTextures[(int)GameTextures.PLAYERTRAP_COLLECTIBLE] = Content.Load<Texture2D>("Sprites\\PlayerTrap_Collectible");
            gameTextures[(int)GameTextures.BANANA] = Content.Load<Texture2D>("Sprites\\Banana");
            gameTextures[(int)GameTextures.BANANA_MINION] = Content.Load<Texture2D>("Sprites\\Minion2");
            gameTextures[(int)GameTextures.POWERUP_MINION] = Content.Load<Texture2D>("Sprites\\Minion1");
            gameTextures[(int)GameTextures.ALERTED_POLICE_OFFICER] = Content.Load<Texture2D>("Sprites\\AlertedPolice");
            gameTextures[(int)GameTextures.LURKING_POLICE_OFFICER] = Content.Load<Texture2D>("Sprites\\LurkingPolice");
            gameTextures[(int)GameTextures.START_MENU] = Content.Load<Texture2D>("Sprites\\StartMenu");
            gameTextures[(int)GameTextures.TOY_PISTOL] = Content.Load<Texture2D>("Sprites\\ToyGun");
            gameTextures[(int)GameTextures.SCARED_POLICE_OFFICER] = Content.Load<Texture2D>("Sprites\\ScaredPoliceOfficer");
            gameTextures[(int)GameTextures.SCARY_GRU] = Content.Load<Texture2D>("Sprites\\ScaryGru");
            textFont = Content.Load<SpriteFont>("Fonts/gamefont");

            gamePad = new Gamepad(GameManager.GetInstance().Gru, this);
            gamePad.RegisterKeyMapping();
        }