Hi guys, Just been fiddling around with some old code I dug up and woundered if you could help me get collisions working between the cube and the terrain?
REM Terrain
make terrain 1, "land.bmp",
load image "grass1.bmp",3
texture terrain 1,3
REM Collisions
SC_setObjectCollisionOn 1
SC_setupComplexObject 1, 0, 2
make object cube 1,10
position object 1, 0, 0, 1050
Speed as float
Acell as float
Acell=.01
Friction as integer
Friction=150 : `Note: A higher friction value = Less friction(Yea, it's kinda strange)
time=timer()
Do
REM Needed for Timer Based Movement
if screen fps()<>0 then Gametime#=(60.0/screen fps())
`Controls
If Downkey()=1 and speed<1.9
inc Speed,Acell*gametime#
endif
If UPkey()=1 and speed>-1.9
dec Speed,Acell*gametime#
endif
If Rightkey()=1
dec a#,150.0*((speed/10.5))*gametime#
endif
If leftkey()=1
inc a#,150.0*((speed/10.5))*gametime#
endif
REM Effect Object
move object 1,Speed
yrotate object 1,a#
speed=curvevalue(0,speed,friction)
`Effect Camera
posx#=cos(-270-a#) * 30 + object position x(1)
posz#=sin(-270-a#) * 30 + object position z(1)
Position Camera curvevalue(posx#,camera position x(),10),object position y(1)+6,curvevalue(posz#,camera position z(),10)
Point Camera object position x(1),object position y(1)+10,object position z(1)
`Sync/Loop
sync
Loop
wait 10000000
end
Also, any advice on how to make terrain into a object would be hugely helpful.
Thank you,
Violent Pigeon