Levelpack: Secret level support #89

Open
opened 2023-03-08 06:28:58 +00:00 by kirsle · 0 comments
Owner

doodad levelpack create

This would happen in the doodad levelpack create command: Add CLI flags to mark certain .level filenames as hidden, like:

doodad levelpack create --hidden=Secret.level \
	OUTPUT.levelpack Level1.level Level2.level Secret.level

In the LevelPack JSON format, hidden levels are marked by a Hidden boolean on the pkg/levelpack/Level struct.

Story Mode window

In the "Story Mode" window (levelpack_open.go):

  • Only draw a button for Hidden levels IF the user has completed them and has it in their savegame.json.
  • Secret levels can be manually ordered in between actual levels.

Shell command to play secret levels

There should be a cheat code (maybe the "unlock all levels" cheat?) or a developer shell command to play secret levels.

Command would be like:

> open filename.level
> open tutorial.levelpack lesson-1.level

The existing open filename.level which can process level and doodad filenames could also match .levelpack files; and the second argument is the level name to play. So if you know the name (can just open the levelpack as a zip file ;)), you can load any level in it.

"Secret Exit" flags

See #66

A doodad property on the Exit Flag could mark it as a secret exit (or just have a distinct doodad).

Ideas how it could work:

  • If the level is played stand-alone (no levelpack), same as a normal Exit Flag.
  • If the very next level (ordered in the levelpack) is a hidden level, load that level next. (The normal Exit Flag will skip hidden levels)
  • If the next level is not hidden, scan ahead for any hidden level that the player has not yet completed. (e.g.: you can place all yours at the end, give the player many tries and they progressively unlock further hidden levels as they complete more)
  • Choices for how to handle them could be a levelpack config option. (e.g.: also let the user say "shuffle and give a random hidden level the user has not beaten, and if they beat them all, give any random hidden level"

Example: you have a 20 level campaign and you have 3 bonus levels that are mixed in and ordered among the others. Say level 5 has a secret exit and the bonus level is inserted between levels 5 and 6 in your ordering of levels passed in to doodad levelpack create.

Getting the secret exit on level 5 would load the next hidden level (between 5 and 6).

If the next level is not a secret exit (e.g., you put all the secret levels at the end of your levelpack) - it will load the first secret levelpack that you have not completed yet.

## doodad levelpack create This would happen in the `doodad levelpack create` command: Add CLI flags to mark certain .level filenames as hidden, like: ``` doodad levelpack create --hidden=Secret.level \ OUTPUT.levelpack Level1.level Level2.level Secret.level ``` In the LevelPack JSON format, hidden levels are marked by a Hidden boolean on the pkg/levelpack/Level struct. ## Story Mode window In the "Story Mode" window (levelpack_open.go): * Only draw a button for Hidden levels **IF** the user has completed them and has it in their savegame.json. * Secret levels can be manually ordered in between actual levels. ## Shell command to play secret levels There should be a cheat code (maybe the "unlock all levels" cheat?) or a developer shell command to play secret levels. Command would be like: ``` > open filename.level > open tutorial.levelpack lesson-1.level ``` The existing `open filename.level` which can process level and doodad filenames could also match .levelpack files; and the second argument is the level name to play. So if you know the name (can just open the levelpack as a zip file ;)), you can load any level in it. ## "Secret Exit" flags See #66 A doodad property on the Exit Flag could mark it as a secret exit (or just have a distinct doodad). Ideas how it could work: * If the level is played stand-alone (no levelpack), same as a normal Exit Flag. * If the very next level (ordered in the levelpack) is a hidden level, load that level next. (The normal Exit Flag will skip hidden levels) * If the next level is _not_ hidden, scan ahead for any hidden level that the player has not yet completed. (e.g.: you can place all yours at the end, give the player many tries and they progressively unlock further hidden levels as they complete more) * Choices for how to handle them could be a levelpack config option. (e.g.: also let the user say "shuffle and give a random hidden level the user has not beaten, and if they beat them all, give any random hidden level" Example: you have a 20 level campaign and you have 3 bonus levels that are mixed in and ordered among the others. Say level 5 has a secret exit and the bonus level is inserted between levels 5 and 6 in your ordering of levels passed in to `doodad levelpack create`. Getting the secret exit on level 5 would load the _next_ hidden level (between 5 and 6). If the next level is not a secret exit (e.g., you put all the secret levels at the end of your levelpack) - it will load the first secret levelpack that you have not completed yet.
kirsle added the
enhancement
label 2023-03-08 06:28:58 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: SketchyMaze/doodle#89
No description provided.