Need help with physics

Blitz3D Forums/Blitz3D Programming/Need help with physics

I think your Get_speed() function is returning the x speed every time, correct it to this (I think):
Function Get_speed#(ship1,axis)
s.ship=Object.ship(EntityName(ship1))
select axis
case 0
Return Float ((s\new_x-s\old_x)/10)
case 1
Return Float ((s\new_y-s\old_y)/10)
case 2
Return Float ((s\new_z-s\old_Z)/10)
end select
End Function

And then change your Ship_collision() function to this:
Function Ship_Collision(ship1,ship2)

s.ship=Object.ship(ship2)
collider=ship1


If s<>Null

xspeed#=Get_speed(collider,0)-get_speed(s\ship_handle,0)
yspeed#=get_speed(collider,1)-get_speed(s\ship_handle,1)
zspeed#=get_speed(collider,2)-get_speed(s\ship_handle,2)

translateentity s\ship_handle,xspeed,yspeed,zspeed

endif

End Function


Hope this helps.