RayLib 2D Challenge Part 12 – Building a Game Engine Resource Manager

Last time we had Scarfy cheerfully running around collecting coins. Clink clink clink! But, a problem was looming. Every coin/object was loading its own copy of the textures & sounds that it used. That’s a massive waste, especially when you’ve got a few hundred identical looking coins.It’s increasing loading times, massively inflating memory usage, and […]

Raylib 2D Challenge Part 11 – Collecting Coins (a.k.a., Making Objects Interact in the Game World)

In the previous RayLib 2D Challenge episode, animated shiny gold coins were spinning nicely. They were loaded from disk using a texture atlas, so adding animated gems or other objects would be ridiculously easy. But, poor Scarfy couldn’t collect the coins, because the coin collection code hadn’t been written yet. All he could do was […]

RayLib 2D Challenge Part 8 – Walking on Terrain (Simulating Physics)

Part 7 of this challenge got a 2D camera working that smoothly tracks the player. Everything looks great until Scarfy walks too far in either direction. At that point it’s obvious that the ground was totally faked. Here’s the offending code:auto boundingRect = actor->getBoundingBox(); auto distToGround = groundYPos – (boundingRect.y + boundingRect.height); bool isOnGround = […]

Shopping Cart
Scroll to Top