Ok..thanks!
But now I have a Collision detection problem. I tried out your tutorial, but couldn't get it to work. Here's my code, I modified it so it didn't change colors, however:
REM level 1
Rem Make Matrix
MAKE MATRIX 1,2500,2500, 25.5,25.5
SET MATRIX WIREFRAME OFF 1
POSITION MATRIX 1, -10,-10,-10
Rem create walls
MAKE OBJECT BOX 2, 15,80,2000
MAKE OBJECT BOX 3, 1300,80,15
MAKE OBJECT BOX 4, 15,80,2450
MAKE OBJECT BOX 5, 15,80,2450
MAKE OBJECT BOX 6, 2490,80,20
MAKE OBJECT BOX 7, 1800,80,20
Rem Position Walls
POSITION OBJECT 2, 100,30,1250
POSITION OBJECT 3, 757,30,800
POSITION OBJECT 4, 20,30,1250
POSITION OBJECT 5, 2485,30,1250
POSITION OBJECT 6, 1255,30,2485
POSITION OBJECT 7, 993,30,2260
Rem Color Walls
COLOR OBJECT 2, rgb(12,150,134)
COLOR OBJECT 3, rgb(12,150,134)
COLOR OBJECT 4, rgb(12,150,134)
COLOR OBJECT 5, rgb(12,150,134)
COLOR OBJECT 6, rgb(12,150,134)
COLOR OBJECT 7, rgb(12,150,134)
Rem Create sphere
Make object sphere 1,50
Position Object 1,100, 1,100
COLOR OBJECT 1, rgb(15,255,255)
Rem Main loop
Do
Rem Store Object angle Y in aY#
aY# = Object angle Y(1)
Rem Control input for camera
If Upkey()=1 then Move object 1,10
If Leftkey()=1 then Yrotate object 1,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 1,Wrapvalue(aY#+5)
If downkey()=1 then Move object 1,-10
Rem get player object position and store in X# and Z#
X# = Object position x(1)
Z# = Object position z(1)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Rem position camera
Position Camera cX#,100,cZ#
Rem point the camera at the player object
Point camera X#,50,Z#
Rem collision detection
If OBJECT HIT(1,2)=1
FirstHit=1
Endif
If FirstHit=1
C=OBJECT COLLISION(1,2)
Endif
Sync
Loop
End
What's wrong?