Well I got the cubes to do what I wanted.Now I want the camera to have a limit,just not sure how to stop it.
Here is the full code.
``Loading prompt
sync
center text screen width()/2,screen height()/2,"LOADING"
sync
set display mode 880,640,16
make()
`first row | `second row
dim Y#(8,8)
y#(1,1)=35 : y#(2,1)=-68
y#(1,2)=36 : y#(2,2)=-67
y#(1,3)=35 : y#(2,3)=-66
y#(1,4)=34 : y#(2,4)=-65
y#(1,5)=33 : y#(2,5)=-64
y#(1,6)=32 : y#(2,6)=-63
y#(1,7)=31 : y#(2,7)=-62
y#(1,8)=30 : y#(2,8)=-61
sync on:do
gosub Y_move
gosub Hit
``First row
position object 1,-53,y#(1,1),70: rotate object 1,1,object angle y(1)+1,0
position object 2,-37,y#(1,2),70: rotate object 2,1,object angle y(2)+1,0
position object 3,-22,y#(1,3),70: rotate object 3,1,object angle y(3)+1,0
position object 4,-8,y#(1,4),70: rotate object 4,1,object angle y(4)+1,0
position object 5,6,y#(1,5),70: rotate object 5,1,object angle y(5)+1,0
position object 6,20,y#(1,6),70: rotate object 6,1,object angle y(6)+1,0
position object 7,34,y#(1,7),70: rotate object 7,1,object angle y(7)+1,0
position object 8,49,y#(1,8),70: rotate object 8,1,object angle y(8)+1,0
``Second row
position object 9,-53,y#(2,1),70: rotate object 9,1,object angle y(9)+1,0
position object 10,-37,y#(2,2),70: rotate object 10,1,object angle y(10)+1,0
position object 11,-22,y#(2,3),70: rotate object 11,1,object angle y(11)+1,0
position object 12,-8,y#(2,4),70: rotate object 12,1,object angle y(12)+1,0
position object 13,6,y#(2,5),70: rotate object 13,1,object angle y(13)+1,0
position object 14,20,y#(2,6),70: rotate object 14,1,object angle y(14)+1,0
position object 15,34,y#(2,7),70: rotate object 15,1,object angle y(15)+1,0
position object 16,49,y#(2,8),70: rotate object 16,1,object angle y(16)+1,0
`camera controls
if upkey() then move camera 1
if downkey() then move camera -1
if leftkey() then camera_left()
if rightkey() then camera_right()
if shiftkey():pitch_up():endif
if controlkey():pitch_down():endIf
sync:loop
function make()
make object cube 1,10
make object cube 2,10
make object cube 3,10
make object cube 4,10
make object cube 5,10
make object cube 6,10
make object cube 7,10
make object cube 8,10
make object cube 9,10
make object cube 10,10
make object cube 11,10
make object cube 12,10
make object cube 13,10
make object cube 14,10
make object cube 15,10
make object cube 16,10
endfunction
function camera_left()
turn camera left 90
move camera 0.4
turn camera right 90
endfunction
function camera_right()
turn camera right 90
move camera 0.4
turn camera left 90
endfunction
function pitch_up()
pitch camera up 90
move camera .5
pitch camera down 90
endfunction
function pitch_down()
pitch camera up 90
move camera -.5
pitch camera down 90
endfunction
Y_move:
`set movement limit
if y#(1,1)>28 then reverseY=1
if y#(1,1)<-51 then reverseY=0
if y#(1,2)>28 then reverseY2=1
if y#(1,2)<-51 then reverseY2=0
if y#(1,3)>28 then reverseY3=1
if y#(1,3)<-51 then reverseY3=0
if y#(1,4)>28 then reverseY4=1
if y#(1,4)<-51 then reverseY4=0
if y#(1,5)>28 then reverseY5=1
if y#(1,5)<-51 then reverseY5=0
if y#(1,6)>28 then reverseY6=1
if y#(1,6)<-51 then reverseY6=0
if y#(1,7)>28 then reverseY7=1
if y#(1,7)<-51 then reverseY7=0
if y#(1,8)>28 then reverseY8=1
if y#(1,8)<-51 then reverseY8=0
`reverse movement
if reverseY=1 then y#(1,1)=y#(1,1)-0.4
if reverseY=0 then y#(1,1)=y#(1,1)+0.4
if reverseY2=1 then y#(1,2)=y#(1,2)-0.4
if reverseY2=0 then y#(1,2)=y#(1,2)+0.4
if reverseY3=1 then y#(1,3)=y#(1,3)-0.4
if reverseY3=0 then y#(1,3)=y#(1,3)+0.4
if reverseY4=1 then y#(1,4)=y#(1,4)-0.4
if reverseY4=0 then y#(1,4)=y#(1,4)+0.4
if reverseY5=1 then y#(1,5)=y#(1,5)-0.4
if reverseY5=0 then y#(1,5)=y#(1,5)+0.4
if reverseY6=1 then y#(1,6)=y#(1,6)-0.4
if reverseY6=0 then y#(1,6)=y#(1,6)+0.4
if reverseY7=1 then y#(1,7)=y#(1,7)-0.4
if reverseY7=0 then y#(1,7)=y#(1,7)+0.4
if reverseY8=1 then y#(1,8)=y#(1,8)-0.4
if reverseY8=0 then y#(1,8)=y#(1,8)+0.4
`set movement limit
if y#(2,1)<-59 then reverseYY=0
if y#(2,1)>27 then reverseYY=1
if y#(2,2)<-59 then reverseYY2=0
if y#(2,2)>27 then reverseYY2=1
if y#(2,3)<-59 then reverseYY3=0
if y#(2,3)>27 then reverseYY3=1
if y#(2,4)<-59 then reverseYY4=0
if y#(2,4)>27 then reverseYY4=1
if y#(2,5)<-59 then reverseYY5=0
if y#(2,5)>27 then reverseYY5=1
if y#(2,6)<-59 then reverseYY6=0
if y#(2,6)>27 then reverseYY6=1
if y#(2,7)<-59 then reverseYY7=0
if y#(2,7)>27 then reverseYY7=1
if y#(2,8)<-59 then reverseYY8=0
if y#(2,8)>27 then reverseYY8=1
`reverse movement
if reverseYY=0 then y#(2,1)=y#(2,1)+0.4
if reverseYY=1 then y#(2,1)=y#(2,1)-0.4
if reverseYY2=0 then y#(2,2)=y#(2,2)+0.4
if reverseYY2=1 then y#(2,2)=y#(2,2)-0.4
if reverseYY3=0 then y#(2,3)=y#(2,3)+0.4
if reverseYY3=1 then y#(2,3)=y#(2,3)-0.4
if reverseYY4=0 then y#(2,4)=y#(2,4)+0.4
if reverseYY4=1 then y#(2,4)=y#(2,4)-0.4
if reverseYY5=0 then y#(2,5)=y#(2,5)+0.4
if reverseYY5=1 then y#(2,5)=y#(2,5)-0.4
if reverseYY6=0 then y#(2,6)=y#(2,6)+0.4
if reverseYY6=1 then y#(2,6)=y#(2,6)-0.4
if reverseYY7=0 then y#(2,7)=y#(2,7)+0.4
if reverseYY7=1 then y#(2,7)=y#(2,7)-0.4
if reverseYY8=0 then y#(2,8)=y#(2,8)+0.4
if reverseYY8=1 then y#(2,8)=y#(2,8)-0.4
return
Hit:
if object hit (1,9) then reverseY=0 and reverseY=1
if object hit (9,1) then reverseYY=1 and reverseYY=0
if object hit (2,10) then reverseY2=0 and reverseY2=1
if object hit (10,2) then reverseYY2=1 and reverseYY2=0
if object hit (3,11) then reverseY3=0 and reverseY3=1
if object hit (11,3) then reverseYY3=1 and reverseYY3=0
if object hit (4,12) then reverseY4=0 and reverseY4=1
if object hit (12,4) then reverseYY4=1 and reverseYY4=0
if object hit (5,13) then reverseY5=0 and reverseY5=1
if object hit (13,5) then reverseYY5=1 and reverseYY5=0
if object hit (6,14) then reverseY6=0 and reverseY6=1
if object hit (14,6) then reverseYY6=1 and reverseYY6=0
if object hit (7,15) then reverseY7=0 and reverseY7=1
if object hit (15,7) then reverseYY7=1 and reverseYY7=0
if object hit (8,16) then reverseY8=0 and reverseY8=1
if object hit (16,8) then reverseYY8=1 and reverseYY8=0
return