feat: add basic menu state
This commit is contained in:
parent
29225b7007
commit
53a31ea8ad
1 changed files with 28 additions and 0 deletions
28
game/state/handlers/menu.go
Normal file
28
game/state/handlers/menu.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"tetris/engine/render"
|
||||
"tetris/game/state"
|
||||
|
||||
rl "github.com/gen2brain/raylib-go/raylib"
|
||||
)
|
||||
|
||||
type Menu struct{}
|
||||
|
||||
func (menu *Menu) Enter() {
|
||||
}
|
||||
|
||||
func (menu *Menu) Exit() {
|
||||
}
|
||||
|
||||
func (menu *Menu) Update(fsm state.Transitioner, delta float32) {
|
||||
if rl.IsKeyPressed(rl.KeyEnter) {
|
||||
fsm.Switch("gameplay")
|
||||
}
|
||||
}
|
||||
|
||||
func (menu *Menu) Render() {
|
||||
render.Begin(rl.Black)
|
||||
render.DrawText(250, 400, 32, "Start", rl.White)
|
||||
render.End()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue