This modified code should help you rebuild your app...
` Setup Display
Sync On
` Set Sync Rate
Sync Rate 30
` Disable Automatic Camera Positioning
AUTOCAM OFF
Rem Create matrix
Make Matrix 1,200,200,50,50
Rem create the player object
Make Object Sphere 10, 10
Rem position the player object
Position Object 10, 0,20,0
rem store player's angle
PlayerAngleY# = Object angle Y(10)
` Create A Global Value For The player Speed And Give It A Relative Name
Global PlayerSpeed = 1
` Start The Main Loop
do
Rem position camera
Position Camera OBJECT POSITION X(10),OBJECT POSITION Y(10)+20,OBJECT POSITION Z(10)-50
Rem point the camera at the player object
Point camera OBJECT POSITION X(10),OBJECT POSITION Y(10),OBJECT POSITION Z(10)
` Implement Movement Controls Kind Of Self Explanatory
if rightkey()
position object 10, OBJECT POSITION X(10)+PlayerSpeed,OBJECT POSITION Y(10),OBJECT POSITION Z(10)
endif
if leftkey()
position object 10, OBJECT POSITION X(10)-PlayerSpeed,OBJECT POSITION Y(10),OBJECT POSITION Z(10)
endif
if upkey()
position object 10, OBJECT POSITION X(10),OBJECT POSITION Y(10),OBJECT POSITION Z(10)+PlayerSpeed
endif
if downkey()
position object 10, OBJECT POSITION X(10),OBJECT POSITION Y(10),OBJECT POSITION Z(10)-PlayerSpeed
endif
` Sync The Screen
sync
` Loop The Main Loop
loop
` Good Practice To Place This END Command Here
end
You can actually set all your camera related functions in a single call function... try modularising it all... the sooner you start to modulate everything the better you will get at it and growing a small app to something bigger gets simple and requires no rewriting
If you need help with that let us/me know...
Hope that helped...
EDIT
That is really funny... I just noticed that Rem vs ` breaks line breaks in the CODE blocks... or I just cannot figure which is breaking the white space... EDIT Figured it out... four spaces are removed which in turn remove the line breaks...