Add error handling to WASD inputs

Can't believe I forgot about that
This commit is contained in:
raul 2024-04-11 15:19:04 +02:00
parent 3eacb27315
commit ac3ded6e9a
1 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,7 @@ func initKeybindings(g *gocui.Gui) error {
playerX -= movementStep
return nil
}); err != nil {
log.Panicln(err)
}
if err := g.SetKeybinding("", 'd', gocui.ModNone,
@ -67,6 +68,7 @@ func initKeybindings(g *gocui.Gui) error {
playerX += movementStep
return nil
}); err != nil {
log.Panicln(err)
}
if err := g.SetKeybinding("", 'w', gocui.ModNone,
@ -74,6 +76,7 @@ func initKeybindings(g *gocui.Gui) error {
playerY += movementStep
return nil
}); err != nil {
log.Panicln(err)
}
if err := g.SetKeybinding("", 's', gocui.ModNone,
@ -81,6 +84,7 @@ func initKeybindings(g *gocui.Gui) error {
playerY -= movementStep
return nil
}); err != nil {
log.Panicln(err)
}
return nil