//--set physics--
ph_setgravity (vector(0, 0, 0));
phent_settype (my_submarine, PH_RIGID, PH_BOX);
phent_setmass (my_submarine, 3, PH_SPHERE);
phent_setfriction (my_submarine, 0);
phent_setdamping (my_submarine, 30, 60);
phent_setelasticity (my_submarine, 20, 0);
//--INPUT--
if( key_r ) sub_thrust.x+=10;
if( key_f ) sub_thrust.x=10;
if( key_v ) sub_thrust.x-=10;
phent_addforcelocal( my_submarine, sub_thrust, nullvector );
if( key_a ) phent_addforcelocal( my_submarine, vector(0,-50,0), vector(-30,0,0) );
if( key_d ) phent_addforcelocal( my_submarine, vector(0,50,0), vector(-30,0,0) );
if( key_w ) phent_addforcelocal( my_submarine, vector(0,0,50), vector(50,0,0) );
if( key_s ) phent_addforcelocal( my_submarine, vector(0,0,-50), vector(50,0,0) );