Here's a code snippet for player collision causing boxes to fly around...
while phy get collision data()
a = phy get collision object a()
b = phy get collision object b()
remstart
x# = phy get collision normal force x()
y# = phy get collision normal force y()
z# = phy get collision normal force z()
remend
x# = 1
y# = 0
z# = 1
snd = rnd(5) + 1
if a = 10 and b >= 1300 and b <= 1302
phy add rigid body local force b, x#, y#, z#, 4
position sound snd, object position x(b), object position y(b), object position z(b)
if not sound playing(snd) then play sound snd
endif
if b = 10 and a >= 1300 and b <= 1302
phy add rigid body local force a, x#, y#, z#, 4
position sound snd, object position x(a), object position y(a), object position z(a)
if not sound playing(snd) then play sound snd
endif
if a <> 10 and b <> 10
position sound snd, object position x(a), object position y(a), object position z(a)
if not sound playing(snd) then play sound snd
endif
endwhile
It's not perfect (ahem), and I don't know what the correct commands are for getting the normal force... but it's amusing making the boxes fly around the room like balloons! I really ought to set their mass to something more suitable... the sound effects should only fire when the force is above a threshold, otherwise they fire all the time.
Still, it's a first step.
Pete Goodwin