Пример #1
0
 private void FixedUpdate()
 {
     UpdateOnGround();
     UpdateOnWall();
     mState.Update();
     previousVelocity = rb.velocity;
 }
Пример #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();
     }
     Console.WriteLine(Physics.xVelocity);
 }
Пример #3
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;
     }
 }
Пример #4
0
 //Handles state changes during a regular update
 public void Update(float deltaT)
 {
     currentState.Update(deltaT);
 }