Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualÁlvaro

Posted 06 November 2012 - 12:18 PM

Each bullet needs a velocity vector that looks something like (speed*cos(angle), speed*sin(angle)). You may have to tweak the formula slightly depending on the convention you used to specify the angle.

On a time step of length delta_t, you update the position like this:
new_position.x = old_position.x + velocity.x * delta_t;
new_position.y = old_position.y + velocity.y * delta_t;

As usual, I recommend that you use a unit-length vector instead of an angle to begin with, and then you just need to multiply it by the speed.

#3Álvaro

Posted 06 November 2012 - 12:16 PM

Each bullet needs a velocity vector that looks something like (speed*cos(angle), speed*sin(angle)). You may have to tweak the formula slightly depending on the convention you used to specify the angle.

On each timestep, you update the position like this:
new_position.x = old_position.x + velocity.x;
new_position.y = old_position.y + velocity.y;

As usual, I recommend that you use a unit-length vector instead of an angle to begin with, and then you just need to multiply it by the speed.

#2Álvaro

Posted 06 November 2012 - 12:16 PM

Each bullet needs a velocity vector that looks something like (speed*cos(angle), speed*sin(angle)). You may have to tweak the formula slightly depending on the convention you used to specify the angle.

On each timestep, you update the position like this:
new_position.x = old_position.x + velocity.x;
new_position.y = old_position.y + velocity.y;

As usual, I recommend that you use a unit-length vector instead of an angle to begin with, and then you just need to multiply it by the speed.

#1Álvaro

Posted 06 November 2012 - 12:16 PM

Each bullet needs a velocity vector that looks something like (speed*cos(angle), speed*sin(angle)). You may have to tweak the formula slightly depending on the convention you used to specify the angle.

On each timestep, you update the position like this:
new_position.x = old_position.x + velocity.x;
new_position.y = old_position.y + velocity.y;

As usual, I recommend that you use a unit-length vector instead of an angle to begin with, and then you just need to multiply it by the speed.

PARTNERS