nope, it's a hopeless mess

This commit is contained in:
2024-06-11 19:05:29 +02:00
parent b1b2a6901f
commit 42ee242f0c
21 changed files with 12 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

BIN
src/assets/sprites/grid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

BIN
src/assets/sprites/help.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

BIN
src/assets/sprites/mark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

BIN
src/assets/sprites/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

BIN
src/assets/sprites/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

View File

@@ -48,8 +48,10 @@ func (game *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
} }
func (game *Game) Update() error { func (game *Game) Update() error {
currentscene := game.GetCurrentScene()
for _, scene := range game.Scenes { for _, scene := range game.Scenes {
if scene.IsPrimary() { if scene.IsPrimary() || scene == currentscene {
if quit := scene.Update(); quit != nil { if quit := scene.Update(); quit != nil {
return quit return quit
} }
@@ -57,12 +59,11 @@ func (game *Game) Update() error {
} }
} }
scene := game.GetCurrentScene() next := currentscene.GetNext()
next := scene.GetNext()
if next != game.CurrentScene { if next != game.CurrentScene {
game.Scenes[next].SetPrevious(game.CurrentScene) game.Scenes[next].SetPrevious(game.CurrentScene)
scene.ResetNext() currentscene.ResetNext()
game.CurrentScene = next game.CurrentScene = next
} }

View File

@@ -1,6 +1,7 @@
package main package main
import ( import (
"fmt"
"image/color" "image/color"
"os" "os"
@@ -101,6 +102,7 @@ func (scene *SceneMenu) Init() {
options := NewMenuButton("Options", options := NewMenuButton("Options",
func(args *widget.ButtonClickedEventArgs) { func(args *widget.ButtonClickedEventArgs) {
fmt.Println("menu => options")
scene.SetNext(Options) scene.SetNext(Options)
}) })

View File

@@ -1,8 +1,8 @@
package main package main
import ( import (
"fmt"
"image/color" "image/color"
"os"
"github.com/ebitenui/ebitenui" "github.com/ebitenui/ebitenui"
"github.com/ebitenui/ebitenui/widget" "github.com/ebitenui/ebitenui/widget"
@@ -80,12 +80,13 @@ func (scene *SceneToolbar) SetInitialValue(w *widget.LabeledCheckbox, value bool
func (scene *SceneToolbar) Init() { func (scene *SceneToolbar) Init() {
rowContainer := NewTopRowContainer("Toolbar") rowContainer := NewTopRowContainer("Toolbar")
cancel := NewMenuButton("Close", options := NewToolbarButton(Assets["options"],
func(args *widget.ButtonClickedEventArgs) { func(args *widget.ButtonClickedEventArgs) {
os.Exit(0) fmt.Println("options")
scene.SetNext(Options)
}) })
rowContainer.AddChild(cancel) rowContainer.AddChild(options)
scene.Ui = &ebitenui.UI{ scene.Ui = &ebitenui.UI{
Container: rowContainer.Container(), Container: rowContainer.Container(),