sprite circling around fixed point

BlitzPlus Forums/BlitzPlus Programming/sprite circling around fixed point

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.

Graphics 640,480

SetBuffer BackBuffer()

timer=CreateTimer(30)
amplitude=10
HidePointer
Repeat
	WaitEvent()
	If EventID()=$4001
		If KeyDown(203) amplitude=amplitude+1
		If KeyDown(205)
			amplitude=amplitude-1
			If amplitude<10 amplitude=10
		EndIf
	
		Cls
		
		pointx=MouseX()
		pointy=MouseY()
		
		path=(path+5) Mod 360
		
		objx=Sin(path)*amplitude
		objy=Cos(path)*amplitude

		Color 255,255,255		
		Oval pointx-2,pointy-2,5,5
		
		Color 255,0,0
		Oval pointx+objx-2,pointy+objy-2,5,5
		Text 0,0,"use cursor left/right"
		Flip
	EndIf
Until KeyHit(1)
End