The opening is a script now, not a slice in the wiring
ci/woodpecker/push/ebitengine Pipeline was successful
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:
@@ -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
|
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.
|
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
|
## The world
|
||||||
|
|
||||||
There is exactly one game, so there is exactly one world: `World`, a
|
There is exactly one game, so there is exactly one world: `World`, a
|
||||||
|
|||||||
@@ -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
|
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
|
becomes a memory of what you already tried. Needs a thin override over
|
||||||
`DialogBox`.
|
`DialogBox`.
|
||||||
- **Only beat 3 exists.** The alley is a vertical slice; `bootOpening` sets the
|
- **Only beat 3 exists.** The alley is a vertical slice; the opening script sets
|
||||||
police-tip flag that beat 2 will eventually set.
|
the police-tip flag that beat 2 will eventually set.
|
||||||
- **The render has only been inspected once, by the author of this repo.**
|
- **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
|
Geometry is derived from one font cell and one screen size, but this
|
||||||
environment cannot take a screenshot (both synthetic keystrokes and screen
|
environment cannot take a screenshot (both synthetic keystrokes and screen
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module git.teletypegames.org/games/realworld
|
|||||||
go 1.26.3
|
go 1.26.3
|
||||||
|
|
||||||
require (
|
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
|
github.com/hajimehoshi/ebiten/v2 v2.9.9
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -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.20260830092549-e26f7345c14d h1:4AGtmrWwfnHkJvZ90on1+9bUmZOGSrcIG4KaJFiy+xo=
|
||||||
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/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 h1:+kz5iTT3L7uU+VhlMfTb8hHcxLO3TlaELlX8wa4XjA0=
|
||||||
github.com/ebitengine/gomobile v0.0.0-20250923094054-ea854a63cce1/go.mod h1:lKJoeixeJwnFmYsBny4vvCJGVFc3aYDalhuDsfZzWHI=
|
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=
|
github.com/ebitengine/hideconsole v1.0.0 h1:5J4U0kXF+pv/DhiXt5/lTz0eO5ogJ1iXb8Yj1yReDqE=
|
||||||
|
|||||||
+4
-13
@@ -50,18 +50,9 @@ func New(o Opts) *inkwell.Game {
|
|||||||
registerUI()
|
registerUI()
|
||||||
|
|
||||||
g.StartAt(start)
|
g.StartAt(start)
|
||||||
g.OnStart(inkwell.Seq(bootOpening(start, o.Finale)...))
|
g.OnStart(ScriptOpening)
|
||||||
|
if o.Finale {
|
||||||
|
g.OnFinale(ScriptFinale)
|
||||||
|
}
|
||||||
return g
|
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
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
ScriptOpening = "opening"
|
||||||
ScriptTapeInsert = "tape_insert"
|
ScriptTapeInsert = "tape_insert"
|
||||||
ScriptFinale = "awakening_finale"
|
ScriptFinale = "awakening_finale"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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?"),
|
||||||
|
),
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user