Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to present secondary objects in SDL2 and C++?

slook26slook26 UtahPosts: 4Member

I'm wondering what would be the best way of presenting a layer of objects (secondary) on a map such as grass, treasure chests, signs, fences, houses, etc. My map system is the one from sdltutorials.com which a few tweaks here and there for a camera system.

The game is an adventure game like Zelda A Link To The Past. I don't have the graphics yet, but I'll work on them later.

What I was thinking of doing is doing like I did for my map - it loads in a unique ID and multiplies that by a amount of tiles on the map to get the tile position, but what I'd do is have an object list that lists where the objects are on a map, their unique dimensions (e.g. 240x240 vs a 32x160 area) and just load those objects like I do the map with a unique ID, would this be better for performance? I think that loading each individual item is a bit much as if I have tons of items on the screen and having to blit that itself would get tedious and costly, but maybe I'm wrong.

I'm using C++, SDL2, and vectors to store my map tile information.

Sign In or Register to comment.