set display mode 1024,768,32
 
sync on
autocam off
color backdrop rgb(180,180,250)
hide light 0
make light 1
set light range 1,300
 
sw#=screen width()
sh#=screen height()
aspectratio#=sw#/sh#
 
for n=1 to 100
  make object cube n,rnd(5)+1
  position object n,rnd(20)-10,rnd(20)-10,rnd(20)+20
  color object n,rnd(10000000)
next n
 
make object sphere 1000,1,80,80
position object 1000,0,0,1000
make light 2
set light range 2,20
position light 2,0,0,998
make camera 1
set camera range 1,0.05,10
color backdrop 1,0
position camera 1,0,0,998.9
set camera to image 1,2,128,128
 
hide mouse
 
 
do
 
create bitmap 1,128,128
paste image 2,0,0,1
get image 3,0,0,128,128,1
delete bitmap 1
 
if mousex()>sw#-128 then position mouse sw#-128,mousey()
if mousey()>sh#-128 then position mouse mousex(),sh#-128
 
get image 1,mousex(),mousey(),mousex()+128,mousey()+128/aspectratio#,1
texture object 1000,1
sprite 1,mousex(),mousey(),3
size sprite 1,128,128/aspectratio#
 
sync
loop