Sync On
Sync Rate 60
`Car
Car = 1
Make Object Box Car,20,25,30
Position Object Car,5000/50,0,5000/50
`Land
Make Matrix 1,5000,5000,50,50
`buildings
t=2
For X=0 to 50 Step 2
For Z=0 TO 50 Step 2
Make Object Cube t,5000/50
Position Object t,X*(5000/50),0,Z*(5000/50)
inc t
Next Z
Next X
`car variables
TurnSpeed# = 5
MaxSpeed# = 5
Friction# = 0.95
Aceleration# = 1.2
Do
`print info
Set Cursor 0,0
Print "FPS: ";Screen FPS()
Print "Speed: ";Speed#
TurnSpeed# = Speed#/1.5
`controls
If Upkey()=1 then Inc Speed#,Aceleration#
If Downkey()=1 then Dec Speed#,Aceleration#
If Leftkey()=1 then Turn Object Left Car,TurnSpeed#
If Rightkey()=1 then Turn Object Right Car,TurnSpeed#
`add friction and check max speed limit
If Speed#>MaxSpeed# then Speed# = MaxSpeed#
If Speed#<-MaxSpeed# then Speed# = -MaxSpeed#
Speed# = Speed#*Friction#
`move the car
Move Object Car,Speed#
`position the camera
Position Camera Object Position X(Car),Object Position Y(Car)+300,Object Position Z(Car)
Point Camera Object Position X(Car),Object Position Y(Car),Object Position Z(Car)
Sync
Loop
#edit better version, if you use ngc for collision then you've got a basic engine already.