public static void PickupGold(GamePadState gs, GamePadState previousGamePadState, Player player, GameTime gameTime)
 {
     var pickupGoldButton = actionKeys[Action.PickupGold];
     if (gs.IsButtonDown(pickupGoldButton) && previousGamePadState.IsButtonUp(pickupGoldButton))
     {
         player.AttemptPickupGold();
     }
 }
Esempio n. 2
0
        public ShipActionsView(Game game, Player player, SpriteBatch spriteBatch)
            : base(game)
        {
            this.player = player;
            this.spriteBatch = spriteBatch;

            GoldPickupProgressView = new GoldPickupProgressView(game, spriteBatch, player);
            Game.Components.Add(GoldPickupProgressView);
        }
 public static void FireCannons(GamePadState gs, GamePadState previousGamePadState, Player player, GameTime gameTime)
 {
     if (gs.IsButtonDown(actionKeys[Action.FireLeftCannon]))
     {
         player.FireLeftCannons(gameTime);
     }
     if (gs.IsButtonDown(actionKeys[Action.FireRightCannon]))
     {
         player.FireRightCannons(gameTime);
     }
 }
 public ShipController CreateShipController(Player player)
 {
     return new ShipController(base.Game, player);
 }
 public static void RepairShip(GamePadState gs, GamePadState previousGamePadState, Player player, GameTime gameTime)
 {
     var repairButton = actionKeys[Action.RepairShip];
     if (gs.IsButtonDown(repairButton) && previousGamePadState.IsButtonUp(repairButton))
         player.AttemptRepair();
 }
 public ShipActionsView CreateShipActionsView(Player player)
 {
     return new ShipActionsView(base.Game, player, spriteBatch);
 }
 public KeyboardShipController(Game game, Player player)
     : base(game)
 {
     this.player = player;
 }