Multiple levels, and a levelset can be saved and loaded

There's even a win condition! But right now the game's pretty boring and not resembling the "thinly-disguised lock-and-key puzzle variant" idea I was going for.

2024-10-08-0135-multiple-levels-saved.png

And yes, every level is currently called "Untitled". I have a dialog box in the resource for renaming levels but that'll have to wait.

Which now leaves me with these bullet points in yesterday's blog post:

  • Add buttons
  • Add normally-open/normally-closed doors
  • Implement the puzzles I have on paper (3 so far)
  • Come up with more puzzles

I'm at 1955 lines of code now. This'll probably go past 2000 lines, but I mostly just need to draw stuff and add more logic.


The file-like I/O abstraction I've done will probably be reused for next jam. (Me reusing my code for a Ludum Dare, that'll be a first!)

Also, the levelset handling is, uhh... suspiciously similar to how ZZT does it. Except ZZT dumps stuff into a 20,000 byte buffer and then copies that into a newly-allocated block of memory. But the basic principle of "every level is a packed block shoved into memory and unpacked on demand, and the file is mostly a bunch of length-prefixed blocks containing said level data" is the same.

Speaking of design influences, the level editor pops open a tool window to the side of the window... kinda like how Kye's level editor does it. Except this level editor allows you to edit a full level set instead of a single-board level set. Of course this totally wasn't an influence on the fact that the default level set is called "default.lvl"...

Anyway, this has been a lot of fun and I want to get this finished, and next time I'll be using the same toolchain. I'll probably get some more editor stuff together for some base code though.