Jump to content
  • Advertisement
Sign in to follow this  
phil67rpg

space invaders

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

I will probably get condemned for switching back to c++ and opengl. I like html  and css and javascript but I really enjoy working with c++ and opengl. I am not tryin g to troll. actually I have made some progress on my space invaders game. I am using sprites to draw a space ship and bullets. I have also drawn the bugs and they will disappear when they are hit by a bullet. my question is how do I erase a bug sprite and then draw another bug sprite next to it, just like in space invaders. I just want a small hint because this problem is kind of complex.

Share this post


Link to post
Share on other sites
Advertisement

please go easy on me people, I am trying to do my best. I have already done a pong game and a breakout game. I am practicing working with sprites.

Share this post


Link to post
Share on other sites

my question is how do I erase a bug sprite and then draw another bug sprite next to it, just like in space invaders.

Every frame, only the objects you draw that frame are visible. Thus you "erase" a sprite by simply not drawing it that frame or any frames thereafter.

If you want to draw a sprite next to another sprite, take the first sprite's X coordinate, add an appropriate offset to it (say, the width of that sprite) and draw the second sprite there.

Beyond that you're going to have to post code pertaining to your specific issue if you want more specific help.

Share this post


Link to post
Share on other sites

I have drawn a sprite and then next to it drawn a different sprite, I am using an array to draw the sprites and the different sprites. I have done what josh had he posted in the second paragraph. the one he has posted about drawing and "add an appropriate offset to it"

Share this post


Link to post
Share on other sites

...and what is your current problem? What is the code that reproduces that problem?

Please remember my previous warnings not to turn threads into mini-blogs with nothing but updates about your progress.

Share this post


Link to post
Share on other sites

This topic is 409 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.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!