homing and math

BlitzMax Forums/BlitzMax Beginners Area/homing and math

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.

Put your bound-checking after you've performed your rotation tweak:

	Local TE# = RotaryDir( anglem# , anglet)
			
	If TE# < 0 Then anglem:- Turnrate
	If TE# > 0 Then anglem:+ Turnrate

	While anglem > 360 anglem:-360 Wend
	While anglem <= 0 anglem:+360 Wend