Updated everything else to match

This commit is contained in:
2023-02-02 01:48:16 -05:00
parent 99942466f8
commit 892c74a9da
40 changed files with 304 additions and 759 deletions

View File

@@ -2,7 +2,7 @@ package main
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/flow"
import "git.tebibyte.media/sashakoshka/tomo/layouts"
import "git.tebibyte.media/sashakoshka/tomo/layouts/basic"
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/x"
@@ -13,21 +13,21 @@ func main () {
func run () {
window, _ := tomo.NewWindow(2, 2)
window.SetTitle("adventure")
container := basic.NewContainer(layouts.Vertical { true, true })
container := basicElements.NewContainer(basicLayouts.Vertical { true, true })
window.Adopt(container)
var world flow.Flow
world.Transition = container.DisownAll
world.Stages = map [string] func () {
"start": func () {
label := basic.NewLabel (
label := basicElements.NewLabel (
"you are standing next to a river.", true)
button0 := basic.NewButton("go in the river")
button0 := basicElements.NewButton("go in the river")
button0.OnClick(world.SwitchFunc("wet"))
button1 := basic.NewButton("walk along the river")
button1 := basicElements.NewButton("walk along the river")
button1.OnClick(world.SwitchFunc("house"))
button2 := basic.NewButton("turn around")
button2 := basicElements.NewButton("turn around")
button2.OnClick(world.SwitchFunc("bear"))
container.Warp ( func () {
@@ -39,13 +39,13 @@ func run () {
})
},
"wet": func () {
label := basic.NewLabel (
label := basicElements.NewLabel (
"you get completely soaked.\n" +
"you die of hypothermia.", true)
button0 := basic.NewButton("try again")
button0 := basicElements.NewButton("try again")
button0.OnClick(world.SwitchFunc("start"))
button1 := basic.NewButton("exit")
button1 := basicElements.NewButton("exit")
button1.OnClick(tomo.Stop)
container.Warp (func () {
@@ -56,13 +56,13 @@ func run () {
})
},
"house": func () {
label := basic.NewLabel (
label := basicElements.NewLabel (
"you are standing in front of a delapidated " +
"house.", true)
button1 := basic.NewButton("go inside")
button1 := basicElements.NewButton("go inside")
button1.OnClick(world.SwitchFunc("inside"))
button0 := basic.NewButton("turn back")
button0 := basicElements.NewButton("turn back")
button0.OnClick(world.SwitchFunc("start"))
container.Warp (func () {
@@ -73,14 +73,14 @@ func run () {
})
},
"inside": func () {
label := basic.NewLabel (
label := basicElements.NewLabel (
"you are standing inside of the house.\n" +
"it is dark, but rays of light stream " +
"through the window.\n" +
"there is nothing particularly interesting " +
"here.", true)
button0 := basic.NewButton("go back outside")
button0 := basicElements.NewButton("go back outside")
button0.OnClick(world.SwitchFunc("house"))
container.Warp (func () {
@@ -90,13 +90,13 @@ func run () {
})
},
"bear": func () {
label := basic.NewLabel (
label := basicElements.NewLabel (
"you come face to face with a bear.\n" +
"it eats you (it was hungry).", true)
button0 := basic.NewButton("try again")
button0 := basicElements.NewButton("try again")
button0.OnClick(world.SwitchFunc("start"))
button1 := basic.NewButton("exit")
button1 := basicElements.NewButton("exit")
button1.OnClick(tomo.Stop)
container.Warp (func () {