- fixed obstacle collision and death on obstacle spike - moved player move into separate loop after other collision checks are done - fixed level setup, generation and selection - added test levels for obstacles
34 lines
847 B
Go
34 lines
847 B
Go
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
|
|
)
|
|
|
|
// Wrapper for different screens to be shown, as Welcome, Options,
|
|
// About, Menu Level and of course the actual Levels.
|
|
// 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()
|
|
Clearscreen() bool
|
|
Update() error
|
|
SetLevel(int)
|
|
Draw(screen *ebiten.Image)
|
|
}
|
|
|
|
type SceneName int
|