Building a Cross-Platform C++ GUI App with CMake, Raylib, and Dear ImGui
I want to build cross-platform GUI apps in C++, and I’ve heard that Dear ImGui is awesome. So today, I’m […]
I want to build cross-platform GUI apps in C++, and I’ve heard that Dear ImGui is awesome. So today, I’m […]
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 […]
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 […]
in Part 9 of this challenge, Scarfy was happily jumping and running around in his 2D world, and even had background music. That’s a great achievement, but rather boring. All he can do is run and jump. Today I’m going to add coins for him to collect. He’s going to have fun running around collecting […]
My previous CMake tutorial taught the basics: how to compile multiple source files into one program. That’s great and all, but you’re almost guaranteed to need third-party libraries when writing something that’s actually useful. You don’t want to be writing all that code yourself. So, today we’re going to tackle linking your program to third-party […]
In part 8 of this challenge, physics simulation was added so that Scarfy could walk on the terrain. Today, I’m going to add atmosphere with background music. That might sound simple, and the RayLib part certainly is. Getting the music, though, is another matter…Choosing MusicMusic can create the right atmosphere for a game (or movie). […]
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 = […]
Part 6 of the RayLib 2D Challenge got the 2D tile-map displaying, but scarfy could easily walk off the screen. His 2D world is larger than the screen, but there’s no player tracking camera. That’s today’s task.Click here to watch the video on Odysee.The Rule of ThirdsThe “rule of thirds,” is a rule-of-thumb for taking […]
Good news! Tileson can now handle “collection of images” tile maps. At least, my version does. I’ve yet to share the changes back. Either way, it means we can get to work. Â Click here to watch the video on Odysee. Performance Warning The code for this part is hideously inefficient. For each tile it looks […]
This is NOT what I was planning on writing. I was going to load the tile map created last time, so that Scarfy had a world to run around in. I’d chosen a third-party library to do the heavy lifting, and things were going smoothly. Then it crashed…Click here to watch the video on Odysee.The […]