This commit is contained in:
Vendored
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
{
|
{
|
||||||
"label": "Build & Run",
|
"label": "Build & Run",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "make clean && make build && ./bin/pncdsl-demo",
|
"command": "make clean && make build && ./bin/inkwell-demo",
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -9,9 +9,9 @@ steps:
|
|||||||
image: golang:1.26.3-alpine
|
image: golang:1.26.3-alpine
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache zip make curl git
|
- apk add --no-cache zip make curl git
|
||||||
# The go.mod may point at a local ../pncdsl checkout (see README);
|
# The go.mod may point at a local ../inkwell checkout (see README);
|
||||||
# in CI clone the framework next to the workspace so it resolves.
|
# in CI clone the framework next to the workspace so it resolves.
|
||||||
- if grep -q '=> \.\./pncdsl' go.mod; then git clone https://git.teletypegames.org/games/pncdsl ../pncdsl; fi
|
- if grep -q '=> \.\./inkwell' go.mod; then git clone https://git.teletypegames.org/games/inkwell ../inkwell; fi
|
||||||
- make ci-export
|
- make ci-export
|
||||||
|
|
||||||
- name: artifact
|
- name: artifact
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Makefile – Ebitengine project builder
|
# Makefile – Ebitengine project builder
|
||||||
# -----------------------------------------
|
# -----------------------------------------
|
||||||
|
|
||||||
PROJECT = pncdsl-demo
|
PROJECT = inkwell-demo
|
||||||
|
|
||||||
BIN_DIR = bin
|
BIN_DIR = bin
|
||||||
DIST_DIR = dist
|
DIST_DIR = dist
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# pncdsl-demo — Morning Coffee
|
# inkwell-demo — Morning Coffee
|
||||||
|
|
||||||
A short point-and-click adventure built on the
|
A short point-and-click adventure built on the
|
||||||
[`pncdsl`](https://git.teletypegames.org/games/pncdsl) framework. Two scenes,
|
[`inkwell`](https://git.teletypegames.org/games/inkwell) framework. Two scenes,
|
||||||
three items, one NPC dialog and an ending cutscene — small on purpose,
|
three items, one NPC dialog and an ending cutscene — small on purpose,
|
||||||
designed as an end-to-end reference for someone learning the library.
|
designed as an end-to-end reference for someone learning the library.
|
||||||
|
|
||||||
@@ -9,12 +9,12 @@ designed as an end-to-end reference for someone learning the library.
|
|||||||
|
|
||||||
The library is fetched as a regular Go module. Prerequisites: Go 1.24+
|
The library is fetched as a regular Go module. Prerequisites: Go 1.24+
|
||||||
and SSH access to `git.teletypegames.org` (the private host that serves the
|
and SSH access to `git.teletypegames.org` (the private host that serves the
|
||||||
`pncdsl` repo).
|
`inkwell` repo).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone ssh://git@git.teletypegames.org:2222/games/pncdsl-demo
|
git clone ssh://git@git.teletypegames.org:2222/games/inkwell-demo
|
||||||
cd pncdsl-demo
|
cd inkwell-demo
|
||||||
go mod tidy # fetches git.teletypegames.org/games/pncdsl
|
go mod tidy # fetches git.teletypegames.org/games/inkwell
|
||||||
go run .
|
go run .
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -37,10 +37,10 @@ permanent.)
|
|||||||
### Local-development override
|
### Local-development override
|
||||||
|
|
||||||
While iterating on the framework and the demo in parallel, point Go at a
|
While iterating on the framework and the demo in parallel, point Go at a
|
||||||
local checkout of `pncdsl` with a temporary `replace` directive:
|
local checkout of `inkwell` with a temporary `replace` directive:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go mod edit -replace=git.teletypegames.org/games/pncdsl=../pncdsl
|
go mod edit -replace=git.teletypegames.org/games/inkwell=../inkwell
|
||||||
go mod tidy
|
go mod tidy
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ per file, no constructor functions. `main.go` only calls `lib.Run()`.
|
|||||||
main.go embeds assets/ (go:embed) and calls lib.Run()
|
main.go embeds assets/ (go:embed) and calls lib.Run()
|
||||||
lib/
|
lib/
|
||||||
setup.go Run() and Build(); the only wiring code
|
setup.go Run() and Build(); the only wiring code
|
||||||
assets.go var Assets []pncdsl.Asset
|
assets.go var Assets []inkwell.Asset
|
||||||
flags.go flag-name constants
|
flags.go flag-name constants
|
||||||
character.player.go var Player
|
character.player.go var Player
|
||||||
character.cat.go var Cat
|
character.cat.go var Cat
|
||||||
@@ -75,7 +75,7 @@ one `Register(...)` line in `lib/setup.go`. No registrar functions, no
|
|||||||
indirection.
|
indirection.
|
||||||
|
|
||||||
The `assets/` tree is compiled into the binary via `go:embed` and
|
The `assets/` tree is compiled into the binary via `go:embed` and
|
||||||
handed to the framework through `pncdsl.AssetFS`, so the js/wasm build
|
handed to the framework through `inkwell.AssetFS`, so the js/wasm build
|
||||||
(`make wasm`) ships with working art. Native builds read from the same
|
(`make wasm`) ships with working art. Native builds read from the same
|
||||||
embedded copy — changing a PNG requires a rebuild. Files listed in
|
embedded copy — changing a PNG requires a rebuild. Files listed in
|
||||||
`lib/assets.go` but missing from `assets/` still fall back to the
|
`lib/assets.go` but missing from `assets/` still fall back to the
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
module git.teletypegames.org/games/pncdsl-demo
|
module git.teletypegames.org/games/inkwell-demo
|
||||||
|
|
||||||
go 1.26.3
|
go 1.26.3
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.teletypegames.org/games/pncdsl v0.0.0-00010101000000-000000000000
|
git.teletypegames.org/games/inkwell v0.0.0-00010101000000-000000000000
|
||||||
github.com/hajimehoshi/ebiten/v2 v2.9.9
|
github.com/hajimehoshi/ebiten/v2 v2.9.9
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -20,4 +20,4 @@ require (
|
|||||||
golang.org/x/sys v0.36.0 // indirect
|
golang.org/x/sys v0.36.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace git.teletypegames.org/games/pncdsl => ../pncdsl
|
replace git.teletypegames.org/games/inkwell => ../inkwell
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
// Assets lists every asset the game references. Files don't need to
|
// Assets lists every asset the game references. Files don't need to
|
||||||
// exist on disk — the library substitutes deterministic colored
|
// exist on disk — the library substitutes deterministic colored
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package lib
|
|||||||
import (
|
import (
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
p "git.teletypegames.org/games/pncdsl"
|
p "git.teletypegames.org/games/inkwell"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Cat = p.Character{
|
var Cat = p.Character{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package lib
|
|||||||
import (
|
import (
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
p "git.teletypegames.org/games/pncdsl"
|
p "git.teletypegames.org/games/inkwell"
|
||||||
)
|
)
|
||||||
|
|
||||||
var Player = p.Character{
|
var Player = p.Character{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var CatMorning = p.Dialogue{
|
var CatMorning = p.Dialogue{
|
||||||
Name: "cat_morning",
|
Name: "cat_morning",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var Beans = p.Item{
|
var Beans = p.Item{
|
||||||
Name: "beans",
|
Name: "beans",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var Key = p.Item{
|
var Key = p.Item{
|
||||||
Name: "key",
|
Name: "key",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var Mug = p.Item{
|
var Mug = p.Item{
|
||||||
Name: "mug",
|
Name: "mug",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var Bedroom = p.Scene{
|
var Bedroom = p.Scene{
|
||||||
Name: "bedroom",
|
Name: "bedroom",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var Kitchen = p.Scene{
|
var Kitchen = p.Scene{
|
||||||
Name: "kitchen",
|
Name: "kitchen",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var IntroScript = p.Script{
|
var IntroScript = p.Script{
|
||||||
Name: "intro",
|
Name: "intro",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
import p "git.teletypegames.org/games/pncdsl"
|
import p "git.teletypegames.org/games/inkwell"
|
||||||
|
|
||||||
var VictoryScript = p.Script{
|
var VictoryScript = p.Script{
|
||||||
Name: "victory",
|
Name: "victory",
|
||||||
|
|||||||
+3
-3
@@ -3,10 +3,10 @@ package lib
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
p "git.teletypegames.org/games/pncdsl"
|
p "git.teletypegames.org/games/inkwell"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Run builds the game and hands it to the pncdsl engine. It is the
|
// Run builds the game and hands it to the inkwell engine. It is the
|
||||||
// single entry point referenced from main.go.
|
// single entry point referenced from main.go.
|
||||||
func Run() {
|
func Run() {
|
||||||
if err := p.Run(Build()); err != nil {
|
if err := p.Run(Build()); err != nil {
|
||||||
@@ -50,7 +50,7 @@ func Build() *p.Game {
|
|||||||
p.RegisterRichUI(g, "", "cat")
|
p.RegisterRichUI(g, "", "cat")
|
||||||
// Replace the framework's in-game ChatLog with the demo's own
|
// Replace the framework's in-game ChatLog with the demo's own
|
||||||
// click-and-type GameChat panel — game-independent chatter that
|
// click-and-type GameChat panel — game-independent chatter that
|
||||||
// does not belong in the pncdsl library.
|
// does not belong in the inkwell library.
|
||||||
g.UIManager.Remove("chat")
|
g.UIManager.Remove("chat")
|
||||||
g.UIManager.Register(Chat)
|
g.UIManager.Register(Chat)
|
||||||
// Swap the rich UI's always-visible verb wheel for a right-click,
|
// Swap the rich UI's always-visible verb wheel for a right-click,
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ package lib
|
|||||||
import (
|
import (
|
||||||
"image/color"
|
"image/color"
|
||||||
|
|
||||||
p "git.teletypegames.org/games/pncdsl"
|
p "git.teletypegames.org/games/inkwell"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MorningCoffeeTheme is the game-specific palette: warm coffee browns
|
// MorningCoffeeTheme is the game-specific palette: warm coffee browns
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/v2/inpututil"
|
"github.com/hajimehoshi/ebiten/v2/inpututil"
|
||||||
"github.com/hajimehoshi/ebiten/v2/vector"
|
"github.com/hajimehoshi/ebiten/v2/vector"
|
||||||
|
|
||||||
p "git.teletypegames.org/games/pncdsl"
|
p "git.teletypegames.org/games/inkwell"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GameChat is a stand-alone chat panel: click to focus, type a message,
|
// GameChat is a stand-alone chat panel: click to focus, type a message,
|
||||||
@@ -190,11 +190,11 @@ func (c *GameChat) Draw(dst *ebiten.Image, ctx *p.UICtx) {
|
|||||||
vector.DrawFilledRect(dst, float32(b.X), float32(inY), float32(b.W), 1, border, false)
|
vector.DrawFilledRect(dst, float32(b.X), float32(inY), float32(b.W), 1, border, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BlocksClickAt implements the pncdsl clickBlocker contract so the
|
// BlocksClickAt implements the inkwell clickBlocker contract so the
|
||||||
// verb-coin doesn't pop up over the chat panel.
|
// verb-coin doesn't pop up over the chat panel.
|
||||||
func (c *GameChat) BlocksClickAt(pt p.Point) bool { return c.Bounds.Contains(pt) }
|
func (c *GameChat) BlocksClickAt(pt p.Point) bool { return c.Bounds.Contains(pt) }
|
||||||
|
|
||||||
// chatTextWidth mirrors the pncdsl text width estimate for the bundled
|
// chatTextWidth mirrors the inkwell text width estimate for the bundled
|
||||||
// debug font (~6 px / glyph). Kept private to the demo.
|
// debug font (~6 px / glyph). Kept private to the demo.
|
||||||
func chatTextWidth(s string) int { return len(s) * 6 }
|
func chatTextWidth(s string) int { return len(s) * 6 }
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/v2"
|
"github.com/hajimehoshi/ebiten/v2"
|
||||||
"github.com/hajimehoshi/ebiten/v2/inpututil"
|
"github.com/hajimehoshi/ebiten/v2/inpututil"
|
||||||
|
|
||||||
p "git.teletypegames.org/games/pncdsl"
|
p "git.teletypegames.org/games/inkwell"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SaveKeys is a no-draw widget that binds F5 → Save(slot 0) and
|
// SaveKeys is a no-draw widget that binds F5 → Save(slot 0) and
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
|
|
||||||
p "git.teletypegames.org/games/pncdsl"
|
p "git.teletypegames.org/games/inkwell"
|
||||||
"git.teletypegames.org/games/pncdsl-demo/lib"
|
"git.teletypegames.org/games/inkwell-demo/lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The asset tree is compiled into the binary so the js/wasm build can
|
// The asset tree is compiled into the binary so the js/wasm build can
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "pncdsl-demo",
|
"name": "inkwell-demo",
|
||||||
"title": "Morning Coffee",
|
"title": "Morning Coffee",
|
||||||
"author": "Teletype Games",
|
"author": "Teletype Games",
|
||||||
"desc": "A short point-and-click adventure built on the pncdsl framework",
|
"desc": "A short point-and-click adventure built on the inkwell framework",
|
||||||
"site": "https://git.teletypegames.org/games/pncdsl-demo",
|
"site": "https://git.teletypegames.org/games/inkwell-demo",
|
||||||
"license": "MIT License",
|
"license": "MIT License",
|
||||||
"version": "1.0.0"
|
"version": "1.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user