survivor

graphical action game for the linux terminal
git clone https://git.ce9e.org/survivor.git

commit
732bfe774c0185f0c2c4d4ddce0974f783af594f
parent
020ef22e84a220ae23cebf59cebd9613927e3b2b
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-04-30 07:42
add vim keybindings

Diffstat

M README.md 5 +----
M src/main.rs 8 ++++----

2 files changed, 5 insertions, 8 deletions


diff --git a/README.md b/README.md

@@ -32,10 +32,7 @@ standard library and libc. You can run `cargo run` to build and execute it.
   32    32 
   33    33 ## Controls
   34    34 
   35    -1 -	Up/w: move up
   36    -1 -	Right/d: move right
   37    -1 -	Down/s: move down
   38    -1 -	Left/a: move left
   -1    35 -	Arrow keys / wasd / hjkl: move
   39    36 -	Space: stop moving
   40    37 -	q: quit
   41    38 

diff --git a/src/main.rs b/src/main.rs

@@ -97,13 +97,13 @@ fn run_in_screen() -> Option<f32> {
   97    97 
   98    98         while let Some(c) = input.getch() {
   99    99             match c {
  100    -1                 b'w' | b'A' => game.player.dir = Some(game::Dir::Up),
  101    -1                 b'a' | b'D' => {
   -1   100                 b'w' | b'k' | b'A' => game.player.dir = Some(game::Dir::Up),
   -1   101                 b'a' | b'h' | b'D' => {
  102   102                     game.player.dir = Some(game::Dir::Left);
  103   103                     game.player.face = game::Dir::Left
  104   104                 }
  105    -1                 b's' | b'B' => game.player.dir = Some(game::Dir::Down),
  106    -1                 b'd' | b'C' => {
   -1   105                 b's' | b'j' | b'B' => game.player.dir = Some(game::Dir::Down),
   -1   106                 b'd' | b'l' | b'C' => {
  107   107                     game.player.dir = Some(game::Dir::Right);
  108   108                     game.player.face = game::Dir::Right
  109   109                 }