merge controller to engine

This commit is contained in:
2023-07-04 23:48:00 +02:00
parent 374f7a9acc
commit 6041c26eaa
6 changed files with 51 additions and 59 deletions

View File

@@ -19,15 +19,15 @@ func (e *Engine) MenuDraw(screen *ebiten.Image) {
func (e *Engine) MenuUpdate() {
menu := e.Domain.GetMenu(e.KContext.Screen.Value)
if e.Controller.UpPressed() && menu.CurrentSelected != 0 {
if e.UpPressed() && menu.CurrentSelected != 0 {
menu.CurrentSelected--
}
if e.Controller.DownPressed() && menu.CurrentSelected != len(menu.MenuItems)-1 {
if e.DownPressed() && menu.CurrentSelected != len(menu.MenuItems)-1 {
menu.CurrentSelected++
}
if e.Controller.Action0Pressed() {
if e.Action0Pressed() {
menu.MenuItems[menu.CurrentSelected].Handler()
}