I have made a map and just as a test to see if i can get the physics working im trying to make it so the ball drops and lands on the map first it didnt have collision but now it just loads the program and then turns the program off can anybody help heres my code:-
sync on : sync rate 60
ODE START
ODE SET WORLD GRAVITY 0, -0.3, 0
load object "sketty.x",1
Sc_setupcomplexobject 1,2,2
ODE CREATE STATIC TRIANGLE MESH 1
ODE SETSURFACE MODE 1,1,1
`test physics sphere
make object sphere 3,5
`Charecter setup
make object sphere 2,4
position object 2,-10,-1,12
sc_setupobject 2,1,0
`Setup physics
ODE CREATE DYNAMIC SPHERE 3
ODE SET BODY MASS 3,7
do
position mouse screen width()/2,screen height()/2
`Camera setup
position camera 0,object position x(2),object position y(2)+6,object position z(2)
rotate camera 0,camera angle x(0)+mousemovey()/2.5,object angle y(2),object angle z(2)
if camera angle x(0) >= 85
xrotate camera 0,85
endif
if camera angle x(0) <= -85
xrotate camera 0,-85
endif
oldx# = object position x(2)
oldy# = object position y(2)
oldz# = object position z(2)
`Setup movement
if keystate(17)=1
move object 2,0.5
endif
if keystate(31)=1
move object 2,-0.5
endif
if keystate(30)=1
move object left 2,0.2
endif
if keystate(32)=1
move object right 2,0.2
endif
if spacekey()=1
position object 2,object position x(2),object position y(2)+0.4,object position z(2)
endif
rotate object 2,object angle x(2),object angle y(2)+mousemovex()/2.5,object angle z(2)
position object 2,object position x(2),object position y(2)-0.2,object position z(2)
x# = object position x(2)
y# = object position y(2)
z# = object position z(2)
collide = sc_sphereSlideGroup(2,oldx#,oldy#,oldz#,x#,y#,z#,4,0)
if collide>0
x# = sc_getCollisionSlideX()
y# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
endif
position object 2,x#,y#,z#
print "x",object angle x(2)
print "y",object angle y(2)
print "z",object angle z(2)
sc_updateobject 2
sc_updateobject 1
ODE UPDATE
sync
loop
Thank you.
Josh
life is short but so am i