mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
examples/platformer: Enable arrow keys
This commit is contained in:
parent
38293f13d5
commit
73a0a6a92b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user