openquell/game/scene.go

34 lines
847 B
Go
Raw Normal View History

2024-02-06 15:26:20 +01:00
package game
import (
"github.com/hajimehoshi/ebiten/v2"
)
const (
Welcome = iota // startup
Menu // main top level menu
Play // actual playing happens here
About // about the game
Settings // options
Popup // in-game options
Select // select which level to play
Nextlevel // displayed after loose or win
)
2024-02-06 15:26:20 +01:00
// Wrapper for different screens to be shown, as Welcome, Options,
2024-02-18 18:19:34 +01:00
// About, Menu Level and of course the actual Levels.
2024-02-06 15:26:20 +01:00
// 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 Scene interface {
SetNext(SceneName)
GetNext() SceneName
ResetNext()
2024-02-18 18:19:34 +01:00
Clearscreen() bool
2024-02-06 15:26:20 +01:00
Update() error
SetLevel(int)
2024-02-06 15:26:20 +01:00
Draw(screen *ebiten.Image)
}
type SceneName int