示例#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);
 }