ok i have a .x world becuase the conpilers wont conpile the lvl i made so i doing it in .x
i want to know how to sotp when hit wall and still beable to move away
load object "map\lvl 1\docking bay2.x",1
position object 1, 1,1,1
make object cube 2,10
Position object 2,1,100,100
position camera 1,-100,1
POINT CAMERA 1,1,1
do
gosub move
loop
move:
x# = object position x(2)
z# = object position z(2)
y# = object position y(2)
Position camera X#,Y#,Z#
SET OBJECT TO camera ORIENTATION 2
OldCamAngleX# = CameraAngleX#
OldCamAngleY# = CameraAngleY#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
Rem Control input for camera
if keystate(17)=1
move object 2,.5
Endif
If keystate(31)=1
move object 2,-.4
Endif
If keystate(30)=1
move object left 2,.5
Endif
If keystate(32)=1
move object right 2,.5
Endif
Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24)
IF OBJECT COLLISION(1,2) THEN POSITION OBJECT 2,x#,Y#,Z#
return