Posted September 18, 2023 by tversteeg
#Rust
This gamejam entry is completely written from scratch in Rust.
The repository for the dinojam code can be found here.
I started by copying some boilerplate for opening a window and drawing pixels to it from my castle-game rewrite: dinojam commit
To enhance the development process, I employed an asset manager that dynamically reloads files from disk when changes occur. For release builds, it seamlessly switches to using embedded assets. Additionally, I’ve included a straightforward font-rendering script based on a horizontal texture of symbols.
All the pixel art in the game was made using Aseprite and then exported as PNG files into the ‘assets/’ folder. Customizable configurations that can be hot-reloaded are stored as TOML files in the same directory.
Initially, I experimented with a virtual camera setup, but it quickly became cumbersome. As a result, I refactored every game object to move with a negative velocity. This approach not only streamlined the code but also prevented potential issues with excessively large position coordinates, which could lead to floating-point inaccuracies.
I briefly considered adding sound, but that meant I had to implement a whole sound engine and I also didn’t feel like spending a lot of time making music, which I’m not particularly good at.
Here’s a list of Rust crates that are used and what they are used for:
*: crates authored by me