Esempio n. 1
0
 public override void Update(GameTime gameTime)
 {
     Physics.Update(gameTime);
     HealthState.Update(gameTime);
     MovementState.Update(gameTime);
     if (Physics.yVelocity > yVelocityThreshholdForFalling)
     {
         MovementState.Fall();
     }
     if (Physics.xVelocity < xVelocityThreshholdForIdling && Physics.xVelocity > -xVelocityThreshholdForIdling)
     {
         MovementState.Idle();
     }
     sprite.Update(gameTime);
     if (Physics.yPosition > Config.GetDespawnThreshhold())
     {
         this.TakeDamage();
     }
     Console.WriteLine(Physics.xVelocity);
 }
Esempio n. 2
0
 public override void Update(GameTime gameTime)
 {
     Physics.Update(gameTime);
     HealthState.Update(gameTime);
     MovementState.Update(gameTime);
     if (Physics.yVelocity > yVelocityThreshholdForFalling)
     {
         MovementState.Fall();
     }
     if (Physics.xVelocity < xVelocityThreshholdForIdling && Physics.xVelocity > -xVelocityThreshholdForIdling)
     {
         MovementState.Idle();
     }
     sprite.Update(gameTime);
     if (Physics.yPosition > Config.GetDespawnThreshhold())
     {
         this.TakeDamage();
     }
     speedMultiplier -= Config.GetSpeedBoostDeteriorationRate();
     if (speedMultiplier < 1.0f)
     {
         speedMultiplier = 1.0f;
     }
 }