hey everybody havent been on here in a while. any way i need some help im not realy making a game im trying to relearn the language so i am just trying everything out. my problem is that i want to make it so that you can ride a bike but i cant even get the camera to follow the bike here is my code i have so far.the part that has the problem is the very last if statement.
Sync On
Sync Rate 30
Hide mouse
Backdrop on
Set camera range 1,5000
rem skybox
load image "C:\program files\dark basic software\darkmatter\models\3ds\skyspheres\sunny beach\sunny beach.jpg",3
load image "C:\program files\dark basic software\darkmatter\models\3ds\skyspheres\sunny beach\sb1.bmp",5
load image "C:\program files\dark basic software\darkmatter\models\3ds\skyspheres\sunny beach\sb3.bmp",6
make object plain 6,10000,1000
texture object 6,3
position object 6,5000,500,0
make object plain 8,10000,1000
position object 8,0,500,5000
rotate object 8,0,90,0
texture object 8,5
make object plain 9,10000,1000
position object 9,10000,500,5000
rotate object 9,0,270,0
texture object 9,5
make object plain 10,10000,1000
position object 10,5000,500,10000
rotate object 10,0,180,0
texture object 10,5
make object plain 11,10000,10000
position object 11,5000,1000,5000
rotate object 11,90,0,0
texture object 11,6
rem river
make object plain 7,100,10000
load image "C:\open ended\water2.bmp",4
texture object 7,4
rotate object 7,90,0,0
position object 7,6000,1,5000
scale object texture 7,.01,1
scroll object texture 7,10,1
ghost object on 7
Rem make matrix
Make matrix 1,10000,10000,20,20
set matrix height 1,11,11,100
Rem texture matrix
Load image "C:\open ended\grass1.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem load textures
load image "C:\Program Files\Dark Basic Software\DarkMATTER\Textures\JPG\Urban\wall_u1_01.jpg",99
rem load objects
rem load ferrari 360
load object "C:\open ended\f360\f360.3ds",1
load image "C:\open ended\f360\fskin.jpg",1
texture object 1,1
scale object 1,2000,2000,2000
f360x#=1000
f360y#=get ground height(1,f360x#,f360z#)
f360z#=1000
rem position object 1,f360x#,f360y#,f360z#
rem -----------------------------------------------
rem load
load object "C:\open ended\simple character.3ds",2
scx#=9000
scy#=get ground height(1,scx#,scz#)
scz#=9000
rem position object 2,scx#,scy#,scz#
rem -----------------------------------------------------------
rem load motorcycle
load object "c:\open ended\motrcycl/motrcycl.3ds",3
mcx#=4000
mcy#=get ground height(1,mcx#,mcz#)
mcz#=4000
rem position object 3,4000,125,5000
rem load house
load object "C:\open ended\house\house.3ds",4
rotate object 4,0,180,0
texture object 4,99
rem -------------------------------------------------------------
load object "C:\open ended\audi\audi.3ds",5
scale object 5,2,2,2
rem -------------------------------------------------------------
load object "C:\open ended\bicycle\bicycle.3ds",12
position object 12,5000,20,5100
bx#= object position x(12)
by#= get ground height(1,bx#,bz#)
bz#= object position x(12)
bxx#=object angle x(12)
byy#=object angle y(12)
bzz#=object angle z(12)
color object 12,rgb(0,0,100)
rem -------------------------------------------------------------
control#=1
position object 1,800,f360y#,1225
position object 2,8000,0,8000
position object 3,4000,0,4000
position object 4,1200,95,1200
position object 5,900,0,1100
rem Randomize the matrix
rem randomize matrix 1,125
X#=5000
Z#=5000
rem ligt
set ambient light 100
Rem Main loop
Do
if spacekey()=1 then control#=2
set cursor 10,10
print x#
print y#
print z#
if control#=1
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,CameraAngleY#,10)
ZTest# = Newzvalue(Z#,CameraAngleY#,10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-180),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-180),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24)
Y# = Get ground height(1,X#,Z#)
Position Camera X#,Y#+50,Z#
endif
if control#=2
if upkey()=1
move object 12,5
move camera 5
endif
if downkey()=1
move object 12,-2
move camera -2
endif
if rightkey()=1 then byy#=byy# +5
if leftkey()=1 then byy#=byy# -5
position camera bx#,by#,bz#
endif
Rem Refresh Screen
Sync
Loop
so far i have tried to make the camera move when you hit the up and down keys and to make the cameras position equal the bike position neither worked so i would appreciate some help. thanks alot.
ultimate skimmer