From 73a0a6a92bb1f7f020eba45ec6a540aa80c571cc Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 29 Oct 2017 00:07:26 +0900 Subject: [PATCH] examples/platformer: Enable arrow keys --- examples/platformer/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/platformer/main.go b/examples/platformer/main.go index 89f317faa..ff7967b58 100644 --- a/examples/platformer/main.go +++ b/examples/platformer/main.go @@ -44,12 +44,12 @@ var ( func update(screen *ebiten.Image) error { // Controls - if ebiten.IsKeyPressed(ebiten.KeyA) { + if ebiten.IsKeyPressed(ebiten.KeyA) || ebiten.IsKeyPressed(ebiten.KeyLeft) { // Selects preloaded sprite loadedSprite = leftSprite // Moves character 3px right charX -= 3 - } else if ebiten.IsKeyPressed(ebiten.KeyD) { + } else if ebiten.IsKeyPressed(ebiten.KeyD) || ebiten.IsKeyPressed(ebiten.KeyRight) { // Selects preloaded sprite loadedSprite = rightSprite // Moves character 3px left