`-----------------------
` SETUP
`-----------------------
sync on
autocam off
 
position camera 0,15,-20
point camera 0,0,0
 
gosub make_image
 
For bx = 1 to 10
   make_box(bx)
   sync
Next bx
 
`-----------------------
` MAIN LOOP
`-----------------------
sync
wait key
END
 
`-----------------------
` FUNCTIONS
`-----------------------
FUNCTION make_box(n)
   `make box
   obj = (n*5)-4
   s = 7+rnd(3)
   make object box obj,s,1,s
remstart
   `make vertice drones
   for v = 1 to 4
      make object sphere obj+v,0.5
      color object obj+v,rgb(255,0,0)
      glue object to limb obj+v,obj,0
   next v
 
   osx = object size x(obj) : osz = object size z(obj)
   position object obj+1, osx/2, 0, osz/2
   position object obj+2, osx/2, 0, -1*(osz/2)
   position object obj+3, -1*(osx/2), 0, -1*(osz/2)
   position object obj+4, -1*(osx/2), 0, osz/2
remend
 
   `position box
   position object obj,-1+rnd(2),n,-1+rnd(2)
   yrotate object obj,rnd(359)
   texture object obj,1
ENDFUNCTION
 
`-----------------------
` GOSUBS
`-----------------------
make_image:
for y = 0 to 100
   for x = 0 to 100
      sh = 200+rnd(40)
      ink rgb(sh,sh,sh),0
      dot x,y
   next x
next y
 
ink rgb(0,150,0),0
set text font "times new roman"
set text size 90
set text to italic
text 15,-5,"P"
set text size 30
text 40,40,"izza"
 
box 100-33,100-16,100,100
ink rgb(150,0,0),0
box 0,100-16,33,100
 
get image 1,0,0,100,100
RETURN