Game Development Reference
In-Depth Information
}
this->setPosition(position);
_dr = _targetRotation - this->getRotation() ;
_ar = _dr * _rotationSpring;
_vr += _ar ;
_vr *= _rotationDamping;
float rotationNow = this->getRotation();
rotationNow += _vr;
this->setRotation(rotationNow);
6. With these lines we determine the new target rotation of our sprite and we run an
animation to rotate the rocket to its target rotation (with a bit of a spring to it).
Search WWH ::




Custom Search