2026-09-08 16:43:22 +02:00
|
|
|
|
2026-06-09 12:26:53 +02:00
|
|
|
# ── Entry point ───────────────────────────────────────────────────────────────
|
2026-06-09 11:08:04 +02:00
|
|
|
label start:
|
2026-09-08 16:43:22 +02:00
|
|
|
jump arrival
|
2026-06-09 12:26:53 +02:00
|
|
|
|
2026-06-20 00:44:12 +02:00
|
|
|
|
2026-09-11 11:38:32 +02:00
|
|
|
# ── Rewind mechanic (shared across all scripts) ──────────────────────────────
|
|
|
|
|
# Where the next rewind lands. Set this at every checkpoint you create.
|
|
|
|
|
default checkpoint = None
|
|
|
|
|
|
|
|
|
|
# Optional: a list of $-statements to run when rewinding (reset flags, etc.).
|
|
|
|
|
# Kept separate from `checkpoint` so the destination label stays a plain string.
|
|
|
|
|
default rewind_reset = []
|
|
|
|
|
|
|
|
|
|
# Plays the shared rewind effect, then returns to `destination`.
|
|
|
|
|
# Uses `call` (not `jump`) so it is re-entrant: rewinding to a label that is
|
|
|
|
|
# already on the call stack (e.g. back to a choice mid-spar) returns cleanly
|
|
|
|
|
# to the caller instead of corrupting the stack.
|
|
|
|
|
# Call as: call rewind_to .some_label
|
|
|
|
|
label rewind_to(destination):
|
|
|
|
|
scene black
|
|
|
|
|
with dissolve
|
|
|
|
|
show screen teal_wash
|
|
|
|
|
"The world pulls back."
|
|
|
|
|
"Colour drains to teal. Sound slows to nothing."
|
|
|
|
|
hide screen teal_wash
|
|
|
|
|
scene black
|
|
|
|
|
with dissolve
|
|
|
|
|
# Run any per-checkpoint reset statements (e.g. $ rewind_used = False)
|
|
|
|
|
for _stmt in rewind_reset:
|
|
|
|
|
$ eval(_stmt)
|
|
|
|
|
call destination
|
|
|
|
|
|
|
|
|
|
|
2026-06-09 12:26:53 +02:00
|
|
|
# ── Screens ───────────────────────────────────────────────────────────────────
|
|
|
|
|
|
2026-09-11 11:38:32 +02:00
|
|
|
# Shared rewind prompt. "Rewind" jumps to .do_rewind, which reads the
|
|
|
|
|
# current `checkpoint` and routes through the reusable rewind_to label.
|
|
|
|
|
# "Continue" just hides the screen and lets the calling script resume.
|
2026-06-09 12:26:53 +02:00
|
|
|
screen rewind_prompt():
|
|
|
|
|
zorder 10
|
2026-09-11 11:38:32 +02:00
|
|
|
textbutton "⟲ Rewind" action Jump(".do_rewind"):
|
2026-06-09 12:26:53 +02:00
|
|
|
xalign 0.05
|
|
|
|
|
yalign 0.95
|
|
|
|
|
size 22
|
2026-09-11 11:38:32 +02:00
|
|
|
color "#4ab8b8"
|
|
|
|
|
textbutton "Continue" action Hide("rewind_prompt"):
|
|
|
|
|
xalign 0.05
|
|
|
|
|
xoffset 120
|
|
|
|
|
yalign 0.95
|
|
|
|
|
size 22
|
|
|
|
|
color "#4ab8b8"
|
|
|
|
|
|
|
|
|
|
# Reads the stored checkpoint and rewinds to it.
|
|
|
|
|
label .do_rewind:
|
|
|
|
|
hide screen rewind_prompt
|
|
|
|
|
if checkpoint is None:
|
|
|
|
|
# No checkpoint set — just resume.
|
|
|
|
|
return
|
|
|
|
|
call rewind_to checkpoint
|
2026-06-09 12:26:53 +02:00
|
|
|
|
|
|
|
|
screen teal_wash():
|
|
|
|
|
zorder 20
|
|
|
|
|
add Solid("#1a4a4a") alpha 0.7
|