public void Update(GameTime gameTime, GameWindow gameWindow, Platforms platforms, ref int shift, PlayerBullets playerBullets, ContentManager content, Enemies enemies, Bullets bullets) { playerAnimation.Update(gameTime); GetHurt(enemies, bullets); KeyboardState newState = Keyboard.GetState(); SetPlayerDirection(oldState, newState); PlayerJump(oldState, newState, gameWindow, platforms, shift); SetVelocity(gameWindow, platforms, ref shift, gameTime); Shoot(oldState, newState, playerBullets, content); if (canMoveRight(gameWindow, platforms, shift) && newState.IsKeyDown(Keys.Right)) { position.X += velocity.X; changeShift(ref shift, gameWindow); } if (canMoveLeft(gameWindow, platforms, shift) && newState.IsKeyDown(Keys.Left)) { position.X -= velocity.X; changeShift(ref shift, gameWindow); } oldState = newState; EndGame(); }
private void GetHurt(Enemies enemies, Bullets bullets) { this.HP -= enemies.DamageDealt(this, bullets); }