sync on
sync rate 10
 
make2images()
 
do
pixelize(1,2)
wait key
pixelize(2,1)
wait key
loop
 
 
function pixelize(img1,img2)
sync on
resstep=7
fadein=0
fadeimage=img1
paste image fadeimage,0,0
sync
 
while fadein<>2
if (resstep<36) AND (resstep>6)
if resstep=7 then resstep=6
paste image fadeimage,0,0
for countx=0 to screen width()/resstep step 1
x=countx*resstep
for county=0 to screen height()/resstep step 1
y=county*resstep
ink point(x+(resstep/2),y+(resstep/2)),rgb(0,0,0)
box x,y,x+resstep,y+resstep
next y
next x
select fadein
case 0 : resstep=(resstep+3) : endcase
case 1 : resstep=(resstep-3) : endcase
endselect
sync
else
select fadein
case 0
fadeimage=img2
fadein=1
resstep=(resstep-3)
endcase
case 1
paste image fadeimage,0,0
sync
fadein=2
endcase
endselect
endif
endwhile
endfunction
 
function make2images()
 
autocam off
color backdrop 0
position camera 0,0,0
for image=1 to 2
for n=1 to 500
if image=1 then make object box n,rnd(10)+1,rnd(10)+1,rnd(10)+1
if image=2 then make object sphere n,rnd(7)+1,20,20
color object n,rnd(1000000000)
position object n,rnd(100)-50,rnd(100)-50,rnd(100)+50
next n
sync
get image image,0,0,screen width(),screen height(),1
delete objects 1,500
next image
 
endfunction