DISCLAIMER: All sprites belong to Nintendo and will be replaced with original artwork in the future.
Description
This project is inspired by Super Mario Maker 2 for the Nintendo Switch. It consists of 2 modes joined by a simple (and very ugly) level select screen. The gameplay mode where you play the levels was made primarily by my friend and collaborator for this project Cate, while I mainly did the level editor and the UI code.
Source Code
The source code can be found here. Below are some examples from the project. More will be added at a later time.
Level Handling
Being a level editor disguised as a game, arguably the most important aspect of a project inspired by Mario Maker needs is the levels. Levels need to be editable, provide physics colliders during gameplay, and be saved to a file. They also need to be flexible and extensible so we can easily add more level elements without breaking things or requiring a rework. Below are my solutions to some of these requirements, starting with serialization.
Level Serialization
For serialization, I made a simple binary file format that uses run-length encoding of tile IDs, as well as a simple header for metadata and information like the name of the level.
This helper function was pretty useful for the serialization process and converting arbitrary datatype to raw bytes.
And the actual serialization function looks like this: