Jump to content
  • Advertisement
Sign in to follow this  
russt17

giving an SDL surface NULL co-ordinates

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

Hi, I'm making a simple game with enemies that you can kill by shooting them. Currently, I have it set up so that when an enemy dies, it's SDL surface's cooridinates are changed to x = 1000 and y = 1000 so that they are not visible on the screen, and I have it so that they aren't being blitted anymore. Is there a way that instead of just moving the enemy's surface I can get rid of the surface entirely once the enemy dies? I'll still have to reuse the surface on the next level of the game, but just right when its killed is there a way to temporarily get rid of the surface just to make the game not have so many loaded surfaces? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
If your enemies all look the same (or even if they didn't really) you only need 1 surface for them. You can blit that same surface in many places. SDL has functions that accept source rectangles as parameters for blitting only a section of a surface to another surface.

Share this post


Link to post
Share on other sites
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!