Hi and Thanks In Advance.
I'm Having Trouble At The First Step Of My Car Game "Car-Struction", I Have Done Acceleration and Deceleration
But Turning Won't Work. So Heres My Code ...
Sync On : Sync Rate 0 : AutoCam Off : Hide Mouse
gosub MakeCar
Make Matrix 1000,1000,1000,100,100
````````````````````````````````````````````````````````````````
`Main Loop
````````````````````````````````````````````````````````````````
Do
gosub MoveCar
gosub Stats
Sync
Loop
`MAKE CAR (Car Object = 1)
`````````````````````````````````````````````````````````````````
MakeCar:
make object Cube 1,10
Position Object 1,100,1.75,100
Return
`````````````````````````````````````````````````````````````````
`Move Car
`````````````````````````````````````````````````````````````````
MoveCar:
CarX# = Object Position x(1)
CarY# = Object Position y(1)
CarZ# = Object Position z(1)
AngY# = 1
If KeyState(17)
if 0>Speed#<2 then Accel#=0.0003
If 2>Speed#<4 then Accel#=0.0002
If Speed#>4 then Accel#=0.0001
Speed# = Speed# + Accel#
If Speed#>0.72 then Speed#=0.708
EndIf
If KeyState(31)
If Speed#>0 then Decel#=0.0005 else Decel#=0.0002
Speed# = Speed# - Decel#
If Speed#<-0.2 then Speed#=-0.185
EndIf
If KeyState(17)=0
If Speed#>0 then Decel#=0.0001 else Decel#=0
Speed# = Speed# - Decel#
EndIf
If KeyState(31)=0
If Speed#<0 then Decel#=0.0001 else Decel#=0
Speed# = Speed# + Decel#
EndIf
if KeyState(30) then yrotate object 1,wrapvalue(object angle y(1)-AngY#)
if KeyState(32) then yrotate object 1,wrapvalue(object angle y(1)+AngY#)
Position Object 1,CarX#,1.75,CarZ#+Speed#
Position Camera CarX#,CarY#+8,CarZ#-24
Return
`````````````````````````````````````````````````````````````````
`On Screen Stats
`````````````````````````````````````````````````````````````````
Stats:
Text 10,10,"Speed : "+Left$(str$(Speed#*100),5)+" Mph"
Return
````````````````````````````````````````````````````````````````
And Also I Have Attached A .Zip Version Including The Car Model.
Yours Tv
<a href = "http://tv_xxx.freespaces.com"><img src="http://signatures.mylivesignature.com/54485/257/30DD50C00B13CFA0CA5A1A58A2D175CD.png"></a>