autocam off : sync on : hide mouse
make object cube 1,20 : speed#=0
make object cube 2,20
position object 2,object position x(1),object position y(1),object position z(1)+100
do
position object 1,object position x(1),object position y(1),object position z(1)
yrotate object 1,object angle y(1)
point camera object position x(1),object position y(1),object position z(1)
cx#=newxvalue(object position x(1),wrapvalue(object angle y(1)+180),250)
cz#=newzvalue(object position z(1),wrapvalue(object angle y(1)+180),250)
position camera cx#,object position y(1)+100,cz#
move object 1,speed#
if upkey()=1 then speed#=2
if upkey()=0 and downkey()=0 then speed#=0
if downkey()=1 then speed#=-2
if upkey()=1 and downkey()=1 then speed#=0
if leftkey()=1 then yrotate object 1,-2
if rightkey()=1 then yrotate object 1,2
sync
loop
end
This code is annoying. You simply control a cube by using the arrow keys. But on my computer the turning is messed up, what is wrong?
Let the games begin.