First play a branching story, then rebuild it with real JavaScript. You'll snap
together functions like scene(), show(), and onPick(โฆ goTo โฆ),
and carry a variable across scenes to decide what the player sees.
A choose-your-path story is built from three small pieces that repeat.
Read it out loud and it sounds like code: โIf the player picks the blue door, then go to the control room.โ That word if is the engine of every game.
One scene can split into two paths. Follow the lines.
// one scene, two choices
if (choice === "blue door") {
goToScene("controlRoom");
}
if (choice === "red door") {
goToScene("glowGarden");
}
Your robot friend Pixel is missing. Make choices to find Pixel. There are three different endings!
This is the code running the scene you're on right now:
You just played the story โ now rebuild it with code using the real chunks. Each
scene() has a name, and a choice uses onPick(โฆ goTo โฆ) to jump to another scene
by its name. Click a block to add it, drag to reorder, then press Run code to play it.
The whole story's blocks โ pick only the ones your mission needs.
Runs from top to bottom.