game skeleton
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package script
|
||||
|
||||
import (
|
||||
inkwell "git.teletypegames.org/engines/inkwell"
|
||||
|
||||
"realworld/internal/names"
|
||||
"realworld/internal/theme"
|
||||
"realworld/internal/world"
|
||||
)
|
||||
|
||||
// awakeningFinale is the end of game two. The point of it, mechanically, is
|
||||
// the theme switch: this is where the Nokia-punk texture breaks in.
|
||||
//
|
||||
// Run it early and often during development (`go run . -finale`) — it is the
|
||||
// single most important visual beat in the game, so you want to be looking at
|
||||
// it long before the surrounding scene exists.
|
||||
func awakeningFinale(w *world.World) inkwell.Script {
|
||||
return inkwell.Script{
|
||||
Name: names.ScriptFinale,
|
||||
Actions: inkwell.Seq(
|
||||
world.SetMode(w, world.ModeCutscene),
|
||||
inkwell.Wait(0.6),
|
||||
inkwell.Say(names.Paul, "I'm putting it in. That's all this is."),
|
||||
inkwell.Wait(0.4),
|
||||
world.UseTheme(theme.NokiaPunk),
|
||||
inkwell.Say("norman", "No — this isn't what you were supposed to do!"),
|
||||
inkwell.Wait(0.6),
|
||||
world.TapeSay(names.TapeMystery, "Thank you, Paul. You did exactly what I asked, the whole way through."),
|
||||
inkwell.Wait(1.0),
|
||||
inkwell.ShowEnd("REAL WORLD — end of game two"),
|
||||
),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// Package script registers the game's named, reusable action sequences —
|
||||
// cutscenes and recurring logic, built from the inkwell action set.
|
||||
package script
|
||||
|
||||
import (
|
||||
inkwell "git.teletypegames.org/engines/inkwell"
|
||||
|
||||
"realworld/internal/world"
|
||||
)
|
||||
|
||||
// Register adds every script to the game.
|
||||
func Register(w *world.World) {
|
||||
for _, s := range []inkwell.Script{
|
||||
tapeInsert(w),
|
||||
awakeningFinale(w),
|
||||
} {
|
||||
w.G.ScriptManager.Register(s)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package script
|
||||
|
||||
import (
|
||||
inkwell "git.teletypegames.org/engines/inkwell"
|
||||
|
||||
"realworld/internal/names"
|
||||
"realworld/internal/world"
|
||||
)
|
||||
|
||||
// tapeInsert runs whenever a tape goes into slot 2: it activates the tape and
|
||||
// makes Dex comment. The wiki calls the comment mandatory — Dex remarks on
|
||||
// every newly loaded tape, without exception.
|
||||
func tapeInsert(w *world.World) inkwell.Script {
|
||||
return inkwell.Script{
|
||||
Name: names.ScriptTapeInsert,
|
||||
Actions: inkwell.Seq(
|
||||
world.Fn(func(ctx *inkwell.Ctx) {
|
||||
item := w.TakePending()
|
||||
if item == "" {
|
||||
return
|
||||
}
|
||||
w.SetSlot2(item)
|
||||
ctx.Game.Inventory.Remove(item)
|
||||
ctx.Game.State.SetVar(names.VarArmillaStrip, "SLOT2: READING")
|
||||
}),
|
||||
inkwell.Say(names.Paul, "Right. Let's see who you are."),
|
||||
world.TapeSay(names.Dex, "Clicked in. Spinning. And now: nothing."),
|
||||
world.TapeSay(names.Dex, "A stranger's tape in your own Armilla, Paul. I hope you know what you're doing."),
|
||||
),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user