From 806ba04cfc6f225df9a3628fefd04578cefdbda5 Mon Sep 17 00:00:00 2001 From: Guillaume Pasquet Date: Mon, 18 Nov 2019 06:26:08 +0000 Subject: Enable arrow key movement for noobs --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 8488a2e..75452d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,6 +61,11 @@ fn main() { InputEvent::Keyboard(KeyEvent::Char('k')) => state.player.move_by(UP).unwrap(), InputEvent::Keyboard(KeyEvent::Char('h')) => state.player.move_by(LEFT).unwrap(), InputEvent::Keyboard(KeyEvent::Char('l')) => state.player.move_by(RIGHT).unwrap(), + // Arrow keys for noobs + InputEvent::Keyboard(KeyEvent::Down) => state.player.move_by(DOWN).unwrap(), + InputEvent::Keyboard(KeyEvent::Up) => state.player.move_by(UP).unwrap(), + InputEvent::Keyboard(KeyEvent::Left) => state.player.move_by(LEFT).unwrap(), + InputEvent::Keyboard(KeyEvent::Right) => state.player.move_by(RIGHT).unwrap(), _ => (), } } -- cgit v1.2.3