/// <summary> /// Executes the specified command. /// </summary> /// <param name="gamepad">The gamepad.</param> public void Execute(Gamepad gamepad) { game.gameState = DespicableGame.GameState.menu; }
/// <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); }
/// <summary> /// Executes the specified command. /// </summary> /// <param name="gamepad">The gamepad.</param> public void Execute(Gamepad gamepad) { game.CreateProjectile(); }
/// <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); }
public void Execute(Gamepad pad) { game.PauseButtonPressAction(); }
/// <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); }
public void Execute(Gamepad pad) { }
/// <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); }
public void Execute(Gamepad pad) { player.Down(); }
public void Execute(Gamepad pad) { player.Up(); }
public void Execute(Gamepad pad) { player.UnleashMinions(); }
public void Execute(Gamepad pad) { player.Right(); }
public void Execute(Gamepad pad) { player.ActivatePowerup(); }
/// <summary> ///Executes the specified command. /// </summary> /// <param name="gamepad">The gamepad.</param> public void Execute(Gamepad gamepad) { game.Pausing(); }
public void Execute(Gamepad pad) { game.Exit(); }
/// <summary> /// Executes the specified command. /// </summary> /// <param name="gamepad">The gamepad.</param> public void Execute(Gamepad gamepad) { game.CreateMinions(); }
public void Execute(Gamepad pad) { player.Left(); }
/// <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)); }
/// <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(); }