Add error handling to WASD inputs
Can't believe I forgot about that
This commit is contained in:
parent
3eacb27315
commit
ac3ded6e9a
|
@ -60,6 +60,7 @@ func initKeybindings(g *gocui.Gui) error {
|
||||||
playerX -= movementStep
|
playerX -= movementStep
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
log.Panicln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := g.SetKeybinding("", 'd', gocui.ModNone,
|
if err := g.SetKeybinding("", 'd', gocui.ModNone,
|
||||||
|
@ -67,6 +68,7 @@ func initKeybindings(g *gocui.Gui) error {
|
||||||
playerX += movementStep
|
playerX += movementStep
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
log.Panicln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := g.SetKeybinding("", 'w', gocui.ModNone,
|
if err := g.SetKeybinding("", 'w', gocui.ModNone,
|
||||||
|
@ -74,6 +76,7 @@ func initKeybindings(g *gocui.Gui) error {
|
||||||
playerY += movementStep
|
playerY += movementStep
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
log.Panicln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := g.SetKeybinding("", 's', gocui.ModNone,
|
if err := g.SetKeybinding("", 's', gocui.ModNone,
|
||||||
|
@ -81,6 +84,7 @@ func initKeybindings(g *gocui.Gui) error {
|
||||||
playerY -= movementStep
|
playerY -= movementStep
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
log.Panicln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue