public void UpdateRotation(bool onGround) { if (((int)type == (int)FlowerHeadType.kFlowerHead_Welly) || ((int)type == (int)FlowerHeadType.kFlowerHead_Daffodil) || ((int)type == (int)FlowerHeadType. kFlowerHead_BushFragment) || ((int)type == (int)FlowerHeadType.kFlowerHead_Tulip) || ((int)type == (int)FlowerHeadType.kFlowerHead_TulipWhite) || ((int)type == (int)FlowerHeadType.kFlowerHead_TulipBlue) || ((int)type == (int)FlowerHeadType.kFlowerHead_TulipYellow) || ((int)type == (int)FlowerHeadType. kFlowerHead_PumpkinPiece) || ((int)type == (int)FlowerHeadType.kFlowerHead_SquashPiece) || ((int)type == (int)FlowerHeadType.kFlowerHead_CourgettePiece)) { if (onGround) { float slowDownSpinSpeed; if (((int)type == (int)FlowerHeadType.kFlowerHead_Tulip) || ((int)type == (int)FlowerHeadType.kFlowerHead_TulipWhite) || ((int)type == (int) FlowerHeadType.kFlowerHead_TulipBlue) || ((int)type == (int)FlowerHeadType.kFlowerHead_TulipYellow)) { slowDownSpinSpeed = 0.012f; } else { slowDownSpinSpeed = 0.006f; } spinSpeed = Utilities.ApproachP1P2(spinSpeed, 0.0f, slowDownSpinSpeed); } rotation += spinSpeed; ((Globals.g_world.game).GetMapObject(mapObjectId)).SetRotation(rotation); ((Globals.g_world.game).GetMapObject(shadowMapObjectId)).SetRotation(rotation); } }
public void UpdateMovement_Oscillate() { if (movement == TractorMovement.kTractorGoingRight) { speed = Utilities.ApproachP1P2(speed, kMaxSpeed, kTractorAcc); if (stateTimer >= kTimeMoving) { stateTimer = 0.0f; movement = TractorMovement.kTractorStoppingRight; } } else if (movement == TractorMovement.kTractorStoppingRight) { speed = Utilities.ApproachP1P2(speed, 0.0f, kTractorAcc); if (stateTimer >= kTimeStopped) { stateTimer = 0.0f; movement = TractorMovement.kTractorGoingLeft; } } else if (movement == TractorMovement.kTractorGoingLeft) { speed = Utilities.ApproachP1P2(speed, -kMaxSpeed, kTractorAcc); if (stateTimer >= kTimeMoving) { stateTimer = 0.0f; movement = TractorMovement.kTractorStoppingLeft; } } else if (movement == TractorMovement.kTractorStoppingLeft) { speed = Utilities.ApproachP1P2(speed, 0.0f, kTractorAcc); if (stateTimer >= kTimeStopped) { stateTimer = 0.0f; movement = TractorMovement.kTractorGoingRight; } } }