I was still mostly working on my level editor, but now that it's mostly working, I can focus more on the game itself.
I've also implemented a simple(ish) configuration format that's basically a .ini file, but with types.
The types dictate how the text to the right of the =
sign gets parsed, which makes for less visual noise compared to something like json.
Though, I have to code the parser of each type myself. For instance, for the color
type, I had to write a function that takes a string, converts the hex code into a set of numbers (emitting a fitting error message if it can't parse it) and returns a color object.
But once that's done, these are reusable. I've even implemented an alias type that allows you to specify a convenient name for a more complex type (types can receive arguments with the <>
syntax).
0 comments