예제 #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);
 }
예제 #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;
     }
 }