should support wasd hey

This commit is contained in:
Josh Deprez 2021-08-07 16:38:02 +10:00 committed by Josh Deprez
parent 074b57f76d
commit 3535cfe248

View file

@ -44,11 +44,11 @@ func (aw *Awakeman) Update() error {
aw.vy += gravity aw.vy += gravity
} }
switch { switch {
case ebiten.IsKeyPressed(ebiten.KeyLeft): case ebiten.IsKeyPressed(ebiten.KeyLeft) || ebiten.IsKeyPressed(ebiten.KeyA):
aw.vx = -runVelocity aw.vx = -runVelocity
aw.SetAnim(aw.animRunLeft) aw.SetAnim(aw.animRunLeft)
aw.facingLeft = true aw.facingLeft = true
case ebiten.IsKeyPressed(ebiten.KeyRight): case ebiten.IsKeyPressed(ebiten.KeyRight) || ebiten.IsKeyPressed(ebiten.KeyD):
aw.vx = runVelocity aw.vx = runVelocity
aw.SetAnim(aw.animRunRight) aw.SetAnim(aw.animRunRight)
aw.facingLeft = false aw.facingLeft = false