gosub set_up
do
paste image 5,0,0
gosub do_math
if ro=1 then zrotate object 1,rot
if ro=2 then yrotate object 1,rot
if ro=3 then zrotate object 1,rot
get image 1,295,413,325,443
sprite 1,700,500,1
scale sprite 1,scal
paste sprite 1,x+ox,y+oy
get image 5,0,0,639,400
sync
loop
end
do_math:
inc rot,rotspeed#
if rot<0 then rot=360
if rot>360 then rot=0
v=v+vn
if v=360
xsize=rnd(50)+50
ysize=rnd(50)+50
v=0:scal=rnd(100)+50
ranv=rnd(1)+1
if ranv=1 then vn=rnd(4)+1
if ranv=2 then vn=rnd(4)-5
gosub get_pic
x=rnd(400)+100:y=rnd(200)+100
rotspeed#=rnd(9)+1
cls 0
rotate object 1,0,0,0
ro=rnd(2)+1
endif
if v=-360
xsize=rnd(50)+50
ysize=rnd(50)+50
v=0:scal=rnd(100)+50
ranv=rnd(1)+1
if ranv=1 then vn=rnd(4)+1
if ranv=2 then vn=rnd(4)-5
gosub get_pic
x=rnd(400)+100:y=rnd(200)+100
rotspeed#=rnd(9)+1
cls 0
rotate object 1,0,0,0
ro=rnd(2)+1
endif
if x<100 then x=rnd(400)+100
if x>500 then x=rnd(400)+100
if y<100 then y=rnd(200)+100
if y>400 then y=rnd(200)+100
ox=cos(v)*xsize
oy=sin(v)*ysize
return
get_pic:
set current bitmap 1
ranpic=rnd(3)+1
for t=1 to 50
ink rgb(rnd(255)+150,rnd(255)+150,rnd(255)+150),0
x1=rnd(30):y1=rnd(30)
if ranpic=1 then box x1,y1,x1+rnd(10),y1+rnd(10)
if ranpic=2 then dot x1,y1
if ranpic=3 then circle x1,y1,rnd(10)
if ranpic=4 then line x1,y1,x1+10,y1+10
next t
get image 2,0,0,30,30
cls 0
set current bitmap 0
texture object 1,2
return
set_up:
randomize timer():cls 0:sync on:backdrop on:color backdrop 0:hide mouse
create bitmap 1,640,480
get image 5,0,0,639,479
make object plain 1,50,50
gosub get_pic
texture object 1,2
position object 1,150,-220,20
position camera 150,0,-250
x=270:y=240:scal=250:xsize=rnd(200)+50:ysize=rnd(200)+50:vn=1:rotspeed#=1
return