If you'd like to see the code, you can find it here.
Handmade Hero is such a treasure trove for programming. I'm only on day 20, but I've already learned and tried out so many new concepts, things I would never be aware of or have had a clue where to start. They are not groundbreaking but rather quite fundamental to programming. Yet it's not something you read about as a web developer. It's not a dis at web programming. I still love the web and writing programs for it. Yet there are so many other aspects of programming left to be explored. It keeps me motivated to know there is a whole lot of programming to be done.
Yesterday on Handmade Hero (I think day 21), Casey was explaining how game code can be dynamically loaded by the platform code. This way, the game code can be reset at any time, and state can be injected to accelerate testing times. It's not something I've ever tried before. It is super fun, although I'm still trying to get it fully working. I've managed to load a part of my code dynamically just by following the Zig documentation on their build system. The current challenge is to load the game code programmatically and manipulate its memory. This has been a challenge that I've faced before when working with memory that does not belong to the current process in Zig. This time I have control over both the caller and the callee, which makes things a lot easier. I'm determined to get it to work. This is quite exciting and a whole lot of fun.