collision detection using direct x

Started by
1 comment, last by hughiecoles 15 years, 4 months ago
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.
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.
"All you have to decide is what to do with the time that is given to you." - Gandalf
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
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried

This topic is closed to new replies.

Advertisement