hi all
im trying to make some simple collision with 2 boxes.
but i cant get it to work, all i want is when the 2 boxes collied, the program should enter a if statement and print "object hit" on the screen.
anyone that can help me with that.
my code is here.
load object "data\cars.x",1
load object "data\road.x",2
do
if upkey()=1
move object 1,0.5
endif
if downkey()=1
move object 1,-0.5
endif
if leftkey()=1
yrotate object 1,wrapvalue(object angle y(1)-0.05)
endif
if rightkey()=1
yrotate object 1,wrapvalue(object angle y(1)+0.05)
endif
X#=object position X(1)
Y#=object position Y(1)
Z#=object position Z(1)
AY#=object angle Y(1)
position camera X#,Y#,Z# `put the camera where the player is
yrotate camera AY# `Yrotating the camera to the player's Y angle
xrotate camera 25 `the camera is looking down a little
move camera -500 `move the camera back a bit
sync
loop
Thx