wrap angle?

BlitzMax Forums/BlitzMax Beginners Area/wrap angle?

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.

not exactly what you're looking for but an alternative non the less.
You could have your 360 deg angles from 0 to 255 and do a bit operator to wrap it around.

your condition would look like this:

angle = (angle + 1) & 255

no if's or divisions.. once you hit 256, it auto wraps to 0. very fast.