Jump to content
  • Advertisement
Sign in to follow this  
yurian

C++ and allegro depth

This topic is 4078 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've sucessfully created a nice maze game with many objects. But when the character walks over a piece of background or annother object, it flickers madly. A bullet or a coin over a piece of background is also flickering. Is there a way I can give each object it's own depth into the screen, so the objects of deeper depth will yield to the objects of lesser depth? Oh, and this is a 2d game using allegro and c++. Help greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Quote:

Original post by yurian
Is there a way I can give each object it's own depth into the screen, so the objects of deeper depth will yield to the objects of lesser depth?


You can assign a depth value to each sprite, but that would only determine their drawing order for your program, i.e., allegro can't use this information internally (I think).

But if you are always drawing the background first and then the objects, there shouldn't be a problem. If you're drawing them in alternating order, that will cause flickering.

Also, are you using double buffering?

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!