Optimising Challenge

BlitzMax Forums/BlitzMax Programming/Optimising Challenge

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

The problem is within the (p2 - p1). If p1 goes below 0, this will result in a positive rotation, which is most likely not the direction you want it to turn.

Thus you must make sure that p1 is a valid, positive angle. To do so, you simply call the function like:

Tween(p1 mod 360,p2 mod 360,t)

Or better, you already wrap the angles to valid positives when you set them instead of converting them when you need them, as this would eat up useless time again.