I'm trying to make a game with a space ship that has the same physics as
the Asteroids ship. you can rotate the ship and accelerate towards the
direction the ship is pointing and no air resistance to slow the ship
down. If you want to stop, you need to accelerate in the opposite
direction of your
You might want to ask this on javagaming.org forums, since it's not
a Java2D-specific question:
http://www.javagaming.org/cgi-bin/JGNetForums/YaBB.cgi#JavaDevelopment
Thanks,
Dmitri
On Wed, May 11, 2005 at 11:00:32AM -0600, Flavius Alecu wrote:
I'm trying to make a game with a
This isn't quite the proper forum to ask about that, but I do have an
answer.
Your velocity is equal to the absolute value of (vel_x * vel_y), so
calculate what vel_x and vel_y are. Then test to see if they are over
max_velocity. If they are scale them back down to fix within
max_velocity.
I think that velocity be Math.sqrt(vel_x*vel_x + vel_y*vel_y). This
is the length of the vector (vel_x, vel_y). The rest of the code looks
right to me.
Dan
Boden, Donovan wrote:
This isn't quite the proper forum to ask about that, but I do have an
answer.
Your velocity is
I'm trying to make a game with a space ship that has the same
physics as
the Asteroids ship. you can rotate the ship and accelerate
towards the
direction the ship is pointing and no air resistance to slow the ship
down. If you want to stop, you need to accelerate in the opposite
direction