Code: (Select All)
_Title "orbit demo" ' bplus 2024-05-08
Screen _NewImage(800, 600, 32)
a& = _LoadImage("alien.png")
time = 3 ' due East degrees = 0
radius = 200
xo = _Width / 2
yo = _Height / 2
While _KeyDown(27) = 0
Cls
For angle = 0 To 359 Step 30
orbit xo, yo, radius, angle - da, x, y
_PutImage (x - _Width(a&) / 2, y - _Height(a&) / 2), a&, 0
orbit xo, yo, radius + 100, angle + da, x, y
_PutImage (x - _Width(a&) / 2, y - _Height(a&) / 2), a&, 0
orbit xo, yo, radius - 100, angle + da, x, y
_PutImage (x - _Width(a&) / 2, y - _Height(a&) / 2), a&, 0
Next
_Display
_Limit 60
da = da + .3
Wend
Sub orbit (x0rigin, yOrigin, radius, degrees, xOut, yOut) ' all default single should be ok
xOut = x0rigin + radius * Cos(_D2R(degrees))
yOut = yOrigin + radius * Sin(_D2R(degrees))
End Sub
alien.png attached
b = b + ...