set global collision on
sync on
sync rate 60
backdrop on
autocam off
make object cube 1,20
set object collision on 1
color object 1,RGB(0,255,0)
Position Object 1,0,0,1
make camera 1
color backdrop 1,RGB(255,0,0)
make object cube 2,20
position object 2,20,20,1
set object collision on 2
Do
position camera 1,OBJECT POSITION X(1),OBJECT POSITION Y(1),OBJECT POSITION Z(1)-120
if upkey()=1 then move object up 1,1
if downkey()=1 then move object down 1,1
if rightkey()=1 then move object right 1,1
if leftkey()=1 then move object left 1,1
text 10,10,str$(OBJECT POSITION X(1))
text 10,20,str$(OBJECT POSITION Y(1))
text 10,30,str$(OBJECT POSITION Z(1))
sync
loop
How would i get this so object 1 won`t go through object 2?
Fixered.
set global collision on
sync on
sync rate 60
backdrop on
autocam off
make object cube 1,20
set object collision on 1
color object 1,RGB(0,255,0)
Position Object 1,0,0,1
make camera 1
color backdrop 1,RGB(255,0,0)
make object cube 2,20
position object 2,20,20,1
set object collision on 2
Do
ox# = OBJECT POSITION X(1)
oy# = OBJECT POSITION Y(1)
oz# = OBJECT POSITION Z(1)
position camera 1,OBJECT POSITION X(1),OBJECT POSITION Y(1),OBJECT POSITION Z(1)-120
if upkey()=1 then move object up 1,1
if downkey()=1 then move object down 1,1
if rightkey()=1 then move object right 1,1
if leftkey()=1 then move object left 1,1
text 10,10,str$(OBJECT POSITION X(1))
text 10,20,str$(OBJECT POSITION Y(1))
text 10,30,str$(OBJECT POSITION Z(1))
IF OBJECT COLLISION(1,2) THEN POSITION OBJECT 1, ox#,oy#,oz#
sync
loop
I want coke, not Pepsi!