|
Hi, i'm making a space game with some realism but am having difficulty working out the script for the ships. The problem is there is no gravity so the ship is always moving and I need to be able to move the mouse around independently (with the ship in motion) and only when thrust is pressed will the ship change course (in the direction the mouse is then pointing to and altered by inertia) rather than the ship constantly following the mouse position. Here is my script so far:
} } Thanks for any help with this.
(comments are locked)
|
|
If you want realism you could just use something like:
There is no friction in space, so in effect there is no maximum speed. Technically there is a limit as you approach the speed of light, in which case you will have to take into account the distortion of light including blue/red shift to have realism. I have played around with this stuff in the past and this makes for a very unplayable game. It's is much easier if you make it more like an aeroplane where turning will change the direction of motion. FYI "thrust" is a measure of force not speed. F = ma. Thanks, the limit for speed will be availability of fuel. This does apply force in a direction but once thrust is pressed and released the force should continue in the same direction (rather than cease) and is still linked to the mouseposition all the time.
Jun 30 '10 at 05:19 PM
user-3343 (google)
A limit of fuel would mean you would stop accelerating when you run out fuel. You would continue at whatever speed you are traveling forever. You would be unable to stop.
Jul 01 '10 at 09:06 AM
_Petroz
(comments are locked)
|
|
Petroz's answer seems to do what you are asking about. If you want to cap the max speed as well, just use:
(comments are locked)
|
