Ejemplo n.º 1
0
        public Player(int x, int y) : base(new FillGenerationStrategy(), x, y, x + HitBoxWidth, y + HitBoxHeight)
        {
            StateMachine      = new PlayerOneStateMachine();
            PlayerOnePowerUps = new PlayerOnePowerUps();

            currentHealth = MaxHealth;
        }
Ejemplo n.º 2
0
        public void Jump(WindowPixel[,] gameScreen)
        {
            if (!isJumping && canJump && !IsShapeHit(gameScreen, CenterPosX, CenterPosY + MovementIncrement) ||
                (!IsShapeHit(gameScreen, CenterPosX, CenterPosY + MovementIncrement) &&//double jump
                 PlayerOnePowerUps.UsePowerUp(PowerUps.Double_Jump)))
            {
                StateMachine.Jump();
                isJumping = true;
                canJump   = false;

                VerticalAcceleration     = JumpAcceleration;
                VerticalAccelerationPool = JumpAccelerationPool;
                VerticalSpeed            = JumpVerticalSpeed;
            }
        }
Ejemplo n.º 3
0
 public void UsePowerUp(PowerUps powerUp)
 {
     PlayerOnePowerUps.UsePowerUp(powerUp);
 }