Sign in to follow this  
phil67rpg

space game

Recommended Posts

phil67rpg    443
I need to do collision detection with direct x and c++. I also need to draw a integer to the screen for scoring purposes. I have 2 sprites and have been able to make them shoot bullets at each other, but I need them to show a explosion sprite when either one is hit. Let me know if you need any more specifics or some code.

Share this post


Link to post
Share on other sites
ICUP    140
Collision Detection:
* Set "hit boxes" for the image. Basically, rectangle clips on the image. If the bullet or whatever is greater than the width of the hit box and within the height of the hit box, then do whatever (i.e., an explosion).

Drawing an integer to the screen:
* I don't use DirectX but generally, you can't draw things to the screen with 'cout' like you normally could in a console environment. DirectX might have functions that convert strings into a surface ready to blit to the screen.

2 Sprites that shoot bullets at each other:
* If you figure out collision detection you should be able to do this. Same thing: hit boxes, check if the bullet is within the parameters of the hit box. When the bullet is within the parameters, blit the sequence of explosion animations.

Share this post


Link to post
Share on other sites
MarijnStevens    210
Make sure your topic name is also where your post is about. space game doesnt even named in the post! The reason I tell this because people who ARE searching, in stand of asking every step on the way, has less change of finding solutions posted in topics with names like this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this