collision detection using direct x
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.
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.
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
EDIT: oh you meant 2D, yeah i agree with the above response
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement