I wounder how to limit objects' movement, or give its movement a range. like rang(xx,xx) or speed !< xx
In my case, I want to let the object rotates until a certain angle, and then let it stop.
If angle <= angle you want - "angle to increase" / increase angle by this value.
Example:
You want it to rotat until its angle is 270°. You rotate it by 10°.
If angle <= 270-10° / angle +10°
If the angle is 260° it will add 10° and then stop.
Thank you Alyra
If angle <= angle you want - "angle to increase" / increase angle by this value. Example: You want it to rotat until its angle is 270°. You rotate it by 10°. If angle <= 270-10° / angle +10° If the angle is 260° it will add 10° and then stop.
Develop games in your browser. Powerful, performant & highly capable.
Ziteng You're welcome.