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

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.

Howdy, Stranger!

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

Categories