public Player(int x, int y) : base(new FillGenerationStrategy(), x, y, x + HitBoxWidth, y + HitBoxHeight) { StateMachine = new PlayerOneStateMachine(); PlayerOnePowerUps = new PlayerOnePowerUps(); currentHealth = MaxHealth; }
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; } }
public void UsePowerUp(PowerUps powerUp) { PlayerOnePowerUps.UsePowerUp(powerUp); }