You should use the physics engine to do that for you. Instead of using c_move, try this:
action spaceship()
{
phent_settype(me,PH_RIGID,PH_BOX);
phent_setmass(me,1000);
phent_setdamping(me,0,0);
phent_enable(me,1);
//All your spaceship code.
}
You should use the physics engine to do that for you. Instead of using c_move, try this:
action spaceship()
{
phent_settype(me,PH_RIGID,PH_BOX); //Turn the ship into a physics entity
phent_setmass(me,1000); //Set the mass, bigger ships should have a higher mass.
phent_setdamping(me,100,100); //Set the damping, angular and linear...
phent_enable(me,1); //Turn on physics engine for this ship.
//All your spaceship code.
}
Then, for setting the rotation of the spaceships, simply do this:
//code before setting rotation
phent_enable(me,0); //Allow manual position and rotation changes
wait(1); //Wait one frame to make sure the changes are actually made
//Set pan, tilt, roll
wait(1); //Wait one frame to prevent glitches
phent_enable(me,1); //Enable physics for the ship
//Code after rotating
To move the spaceships, use the phent_addvellocal function.
phent_addvellocal(me,vector(0,-20,0),vector(0,0,0));
Be sure not to change the second vector, else your spaceship will fly a curve. The second vector is like the thruster position, and the thruster should be in the center of the ship for optimal flight behaviour.
Also, if the ship flies sideways, try
phent_addvellocal(me,vector(-20,0,0),vector(0,0,0));
Also, I guess you don't want any gravity. Put this into function main:
ph_setgravity(vector(0,0,0)); //Zero gravity