Config.json

The  file is the file that tells your level how to build itself. This page will hopefully help you understand what the  does. If it doesn’t, come ask for help in the Mokuzai Studio Discord Server.

Rules of JSON
JSON files have their own set of rules for syntax. w3schools has a pretty good introduction to them. A missing comma or a non-integer value without a leading 0 will crash the game. If you find yourself trying to figure out why your JSON’s no good, my go-to for finding my mistake is usually to head to jsonlint.com, paste in my full JSON text, and figure out where I’ve gone wrong.

The Structure of config.json
config.json is a file that lives in your custom level folder. For the rest of this doc I’ll be assuming that you’ve created and remembered the name of your folder, which should be something simple with no spaces. I find something like my initials and my level name works well. For this example, let’s go with  and , so let’s call the level folder.

“levelSettings”
Up first is the, which will define a lot of the level for you. Everything written with ← here is notes, with a  denoting that the variable can be left blank.

“levelCustomSprites”
The best part of making custom levels is giving them your own visual flair. To do that, you’ll need to create some sprites! Here we will define the sprites and give them variables with the  variable. If you want to know more about sprite importing, like sprite strips and offsets, check out the Sprite Variables page. There’s no hard limit on how many sprites you can import, either!

“levelObjects”
The  section is the real meat and potatoes of the. This is where you tell the level to create each object you want, relative to their  and. Don’t forget that you can find a list of just about every object in the game right here. Objects can all have their own variables, and lots of them. Read more about Object Variables here.

Closing
Here we are, the end of this explanation. I’m sure there’s things that could have been better explained, so if you have questions, make sure to join us in the Mokuzai Studio Discord Server where you can ask questions, suggest changes, and request features. That’s what the  channel is for!