Basically I just wish I still had Minesweeper.
This project is a small suite of classic PC games that I wish were still included with modern computers. I'm planning to write them in Odin, both to learn the language better and to get practice doing simple things with manual memory management.
Jam submission info
This project is my submission to the Handmade Essentials Jam.
As of the jam's completion, I have roughly completed two games: Minesweeper and Solitaire, both essentially clones of the old-school Windows versions. If I had more time, I would have also attempted to implement a pinball game inspired by Windows XP's Space Cadet Pinball.
There is not much to say about how either game plays; they play exactly like the old-school Windows games. One small bonus feature is that you can change the size of the Minesweeper board simply by resizing the window; otherwise, they are clones.
Selected demo videos:
- Minesweeper: https://handmade.network/snippet/4324
- Solitaire: https://handmade.network/snippet/4359, https://handmade.network/snippet/4363
Tech
The games are written in Odin and use the official bindings for SDL3. Overall I found both very pleasant to use. This was my first serious Odin project and my first time ever using SDL, and I found both to be very low-friction and intuitive.
One of the stated goals of the project was to get better at manual memory management. This turned out to mostly be a non-factor, as both games have almost no memory allocation. Minesweeper dynamically allocates its board from an arena, and Solitaire dynamically allocates a list of potentially-clickable objects while drawing the UI. Both games generate string IDs for clickable UI elements. Other than that...not really any allocation. But, having a temporary allocator close at hand was very useful and eliminated a common point of friction when doing basic things like generating IDs.
One small but significant benefit is that Odin just recently (like two weeks ago) added support for fixed-capacity dynamic arrays. This was perfect for Solitaire because I wanted dynamically-sized lists of cards for basically everything in the game. I was therefore able to just spam [dynamic; 52]Card everywhere and then could use append, pop, resize, and clear to my heart's content with no dynamic allocation whatsoever!
As for SDL, I like it just fine but used approximately five SDL functions in total. I would use it again, but I also think raylib would have worked perfectly fine as well, or probably any other platform layer. However, I was very happy that SDL3 has a built-in nine-slicing option for rendering textures, and I made extensive use of it.
I wrote a few thoughts about the drag-and-drop system in this blog post.
Art
I hand-drew all the art assets for these games. I am quite pleased with how they turned out! All the art was done in the Freeform app for iPad, which turns out to be pretty pleasant aside from some massive hitches that occur when attempting to select and move large numbers of strokes. We're talking about multi-second hitches, which is frankly ridiculous on an iPad Pro.
