Here the system is used to check if there's a wall in the way, but it can be used in many other ways. You see, it's the way the game calculate all the interactions of the character with the world, NPCs, etc
I mean, I also kind of proud of myself. 4 years ago I tried to make a game from scratch as well, but I wasn't experienced enough, so one day I realized it was the dead end and I couldn't continue the development as the code I'd written was bad down to the bone... And that mapping system was very heavy yet it was pretty straightforward and couldn't do anything special (it literally loaded the CPU up to 70%! )
Well, some might say, "Hey, isn't that, like, the basics of any video games? Why would you post that?"
Yes, kind of. But! I'm making the game from scratch with no engine, so that's pretty big update for me. By the way, that's the problem any game developer eventually bumps into:
You did a really great-effort update, but it won't bring much attention, as the update wasn't too visual. You basically have nothing to show!
Anyway, besides the mapping and collision, I optimized the way the engine display stuff. Basically there are a few layers, each of them is a pair of two vectors (dynamic arrays). One stores the sprites themselves, another stores shaders, blending modes, etc. This system of layers allows us to chose which sprite will be drawn above another!
0 comments