• Advertisement
Sign in to follow this  

collision detection using direct x

This topic is 3369 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

well I have 2 tanks which shoot bullets and I want them to be hit by bullets, the tanks and bullets are sprites, I am going to use a sprite to show when an tank is hit by a bullet.let me know is you need more info.

Share this post


Link to post
Share on other sites
Advertisement
This might not be the best way, but give each sprite a rectangle variable and set it so that it surrounds the sprite, then check to see if the shape around the sprite touches or intersects the rectangle around another.

Share this post


Link to post
Share on other sites
i believe its customary to model the trajectory of a bullet as a ray, where its position is a function of time. I've never delt with it so i can't really post any code, but you can look into that


EDIT: oh you meant 2D, yeah i agree with the above response

Share this post


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

  • Advertisement