refactored everything, now using scenes, that way I can add UI stuff

This commit is contained in:
2024-05-26 12:29:43 +02:00
parent c8d1faf476
commit 2c246e9e4a
6 changed files with 759 additions and 644 deletions

25
scene.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import "github.com/hajimehoshi/ebiten/v2"
// Wrapper for different screens to be shown, as Welcome, Options,
// About, Menu Level and of course the actual game
// Scenes are responsible for screen clearing! That way a scene is able
// to render its content onto the running level, e.g. the options scene
// etc.
type SceneName int
type Scene interface {
SetNext(SceneName)
GetNext() SceneName
ResetNext()
Clearscreen() bool
Update() error
Draw(screen *ebiten.Image)
}
const (
Menu = iota // main top level menu
Play // actual playing happens here
)