Jump to content
  • Advertisement
Sign in to follow this  
Leo28C

Bullet goes too fast!

This topic is 4059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone! I have a top-down game where the player can shoot bullets in any direction. The bullet's direction is calculated with the player's position and the mouse pointer's position. Collision detection with the walls and other objects works fine; however the bullet sometimes goes too fast. Like, it goes from one side of the wall to the other in one movement, so it doesn't have time to go through the wall. You get my point? How can I make the bullet go at the same speed but being able to see it go all the way? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
In your collision detection, you need to collide the wall not only with the bullet, but with the volume swept out by the bullet since the last time step. (In this case, that probably means treating the bullet as a line segment.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!