dirs
ci/woodpecker/push/ebitengine Pipeline was successful

This commit is contained in:
2026-08-30 23:21:06 +02:00
parent 28b1662195
commit c5c0c02c03
115 changed files with 1083 additions and 950 deletions
+73
View File
@@ -0,0 +1,73 @@
package scene
import (
"strings"
inkwell "git.teletypegames.org/engines/inkwell"
"git.teletypegames.org/games/realworld/inc"
)
var exitToSelector = inkwell.Exit{
To: inc.SceneSelector,
Label: "the rest of the city",
Side: inkwell.ExitNear,
}
func init() {
Manager.Register(Scene{
Name: inc.SceneSelector,
Title: "SAN FRANCISCO",
Background: inc.BgSelector,
Actors: []inkwell.SceneActor{},
Walkboxes: []inkwell.Polygon{},
})
}
func FillSelectorPins() {
selector, ok := Manager.Get(inc.SceneSelector)
if !ok {
return
}
var exits []inkwell.Exit
for _, entity := range Manager.All() {
if !leadsToSelector(entity) {
continue
}
exits = append(exits, inkwell.Exit{
To: entity.Name,
Label: pinLabel(entity.Title),
Area: pin(len(exits)),
})
}
selector.Exits = exits
Manager.Set(selector)
}
func leadsToSelector(s Scene) bool {
for _, e := range s.Exits {
if e.To == inc.SceneSelector {
return true
}
}
return false
}
const (
pinCols = 3
pinW = 192.0
pinH = 32.0
pinX = 16.0
pinY = 28.0
pinGapX = 204.0
pinGapY = 38.0
)
func pin(i int) inkwell.Shape {
col, row := i%pinCols, i/pinCols
return inkwell.Rect(pinX+float64(col)*pinGapX, pinY+float64(row)*pinGapY, pinW, pinH)
}
func pinLabel(title string) string {
name, _, _ := strings.Cut(title, " — ")
return name
}