Graphics mode
Posted: Tue Nov 04, 2014 6:36 pm
Why does this switch out of graphics mode when building sprite--code follows:
option base 1
option angle degrees
option sprite pos central
graphics clear 1,1,1
graphics
gosub Spiralx
gosub DisplaySpiral
end
Spiralx:
cx=42!cy=46
option angle radians
draw alpha 1
sprite "spiral" begin 2*cx,2*cy
draw to cx,cy
draw color 1,0,0
draw size 4
shadow on
a=.02
for t = 0 to (6.28 * 5) step .008
x =a*t * cos(t)
y = a*t * sin(t)
draw line to cx+x ,cy+y
a=(a+.0004)
next t
sprite end
return
DisplaySpiral:
sprite "spiral" show
for i = 1 to 360
sprite "spiral" at 400,400 angle i
pause .2
next i
return
option base 1
option angle degrees
option sprite pos central
graphics clear 1,1,1
graphics
gosub Spiralx
gosub DisplaySpiral
end
Spiralx:
cx=42!cy=46
option angle radians
draw alpha 1
sprite "spiral" begin 2*cx,2*cy
draw to cx,cy
draw color 1,0,0
draw size 4
shadow on
a=.02
for t = 0 to (6.28 * 5) step .008
x =a*t * cos(t)
y = a*t * sin(t)
draw line to cx+x ,cy+y
a=(a+.0004)
next t
sprite end
return
DisplaySpiral:
sprite "spiral" show
for i = 1 to 360
sprite "spiral" at 400,400 angle i
pause .2
next i
return