The opening is a script now, not a slice in the wiring
ci/woodpecker/push/ebitengine Pipeline was successful

bootOpening built its actions in boot.go and appended the finale by hand,
which made the one thing a player sees first the only content not
authored as content. inkwell's OnStart takes a script name now, so the
opening moves to script.opening.go and boot names it.

The -finale flag becomes OnFinale, the engine's hook for a closing script
queued after the start one, so the branch is a hook rather than a slice
append. bootOpening's start parameter had been dead for a while; it goes
with the function.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 11:26:47 +02:00
co-authored by Claude Opus 5
parent 220985ec57
commit 258cbf85c0
7 changed files with 44 additions and 18 deletions
+18
View File
@@ -173,6 +173,24 @@ derives the selector's pins by reading the exit graph backwards. And a manager
swapped in this way must be in place before `inkwell.Run`, which is where the
engine wires up the parts that hold a registry directly.
### What runs at boot
`New` names two scripts and nothing else — the opening a player sees is content
like every other script, in `script.opening.go`, not a slice built in the
wiring:
```go
g.StartAt(start)
g.OnStart(ScriptOpening)
if o.Finale {
g.OnFinale(ScriptFinale)
}
```
`OnFinale` is the engine's hook for a closing script, queued straight after the
opening. Here it is what `-finale` uses to drop into the ending, which is why it
is set from `Opts` rather than always.
## The world
There is exactly one game, so there is exactly one world: `World`, a
+2 -2
View File
@@ -350,8 +350,8 @@ Also: the inkwell README gives the module path as
hides them; the deck wanted them struck through but visible, so the list
becomes a memory of what you already tried. Needs a thin override over
`DialogBox`.
- **Only beat 3 exists.** The alley is a vertical slice; `bootOpening` sets the
police-tip flag that beat 2 will eventually set.
- **Only beat 3 exists.** The alley is a vertical slice; the opening script sets
the police-tip flag that beat 2 will eventually set.
- **The render has only been inspected once, by the author of this repo.**
Geometry is derived from one font cell and one screen size, but this
environment cannot take a screenshot (both synthetic keystrokes and screen
+1 -1
View File
@@ -3,7 +3,7 @@ module git.teletypegames.org/games/realworld
go 1.26.3
require (
git.teletypegames.org/engines/inkwell v0.1.1-0.20260830083613-39af65f3c98f
git.teletypegames.org/engines/inkwell v0.1.1-0.20260830092549-e26f7345c14d
github.com/hajimehoshi/ebiten/v2 v2.9.9
)
+2 -2
View File
@@ -1,5 +1,5 @@
git.teletypegames.org/engines/inkwell v0.1.1-0.20260830083613-39af65f3c98f h1:Qw/sUeJeCBEFvdiqwGUn919hsmoTILJyKSPlkKvNgh0=
git.teletypegames.org/engines/inkwell v0.1.1-0.20260830083613-39af65f3c98f/go.mod h1:/v6QtismTE8+e7kobbVR5B/CpTSrd4j2DYwJ8DvINhs=
git.teletypegames.org/engines/inkwell v0.1.1-0.20260830092549-e26f7345c14d h1:4AGtmrWwfnHkJvZ90on1+9bUmZOGSrcIG4KaJFiy+xo=
git.teletypegames.org/engines/inkwell v0.1.1-0.20260830092549-e26f7345c14d/go.mod h1:/v6QtismTE8+e7kobbVR5B/CpTSrd4j2DYwJ8DvINhs=
github.com/ebitengine/gomobile v0.0.0-20250923094054-ea854a63cce1 h1:+kz5iTT3L7uU+VhlMfTb8hHcxLO3TlaELlX8wa4XjA0=
github.com/ebitengine/gomobile v0.0.0-20250923094054-ea854a63cce1/go.mod h1:lKJoeixeJwnFmYsBny4vvCJGVFc3aYDalhuDsfZzWHI=
github.com/ebitengine/hideconsole v1.0.0 h1:5J4U0kXF+pv/DhiXt5/lTz0eO5ogJ1iXb8Yj1yReDqE=
+4 -13
View File
@@ -50,18 +50,9 @@ func New(o Opts) *inkwell.Game {
registerUI()
g.StartAt(start)
g.OnStart(inkwell.Seq(bootOpening(start, o.Finale)...))
g.OnStart(ScriptOpening)
if o.Finale {
g.OnFinale(ScriptFinale)
}
return g
}
func bootOpening(start string, finale bool) []inkwell.Action {
acts := []inkwell.Action{
inkwell.SetFlag(FlagPoliceTip),
inkwell.Say(Paul, "Back alley. Just like the clerk said."),
TapeSay(Dex, "A government office tipped you off to remove something from a scene. That doesn't strike you as odd?"),
}
if finale {
acts = append(acts, inkwell.RunScript(ScriptFinale))
}
return acts
}
+1
View File
@@ -20,6 +20,7 @@ const (
)
const (
ScriptOpening = "opening"
ScriptTapeInsert = "tape_insert"
ScriptFinale = "awakening_finale"
)
+16
View File
@@ -0,0 +1,16 @@
package inc
import (
inkwell "git.teletypegames.org/engines/inkwell"
)
func init() {
ScriptManager.Register(Script{
Name: ScriptOpening,
Actions: inkwell.Seq(
inkwell.SetFlag(FlagPoliceTip),
inkwell.Say(Paul, "Back alley. Just like the clerk said."),
TapeSay(Dex, "A government office tipped you off to remove something from a scene. That doesn't strike you as odd?"),
),
})
}