[JAVA2D] Acceleration and movement problem

2005-05-11 Thread Flavius Alecu
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

Re: [JAVA2D] Acceleration and movement problem

2005-05-11 Thread Dmitri Trembovetski
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

Re: [JAVA2D] Acceleration and movement problem

2005-05-11 Thread Boden, Donovan
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.

Re: [JAVA2D] Acceleration and movement problem

2005-05-11 Thread Daniel Rice
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

Re: [JAVA2D] Acceleration and movement problem

2005-05-11 Thread Rosenstrauch, David
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