diff --git a/src/player.rs b/src/player.rs index 12105dd..ccb2d4e 100644 --- a/src/player.rs +++ b/src/player.rs @@ -163,21 +163,30 @@ pub fn player_input(gs: &mut State, ctx: &mut Rltk) -> RunState { | VirtualKeyCode::J => try_move_player(0, 1, &mut gs.ecs), // Diagonals - VirtualKeyCode::Numpad9 | VirtualKeyCode::Key9 | VirtualKeyCode::Y => { - try_move_player(1, -1, &mut gs.ecs) - } - VirtualKeyCode::Numpad7 | VirtualKeyCode::Key7 | VirtualKeyCode::U => { - try_move_player(-1, -1, &mut gs.ecs) - } - VirtualKeyCode::Numpad3 | VirtualKeyCode::Key3 | VirtualKeyCode::N => { - try_move_player(1, 1, &mut gs.ecs) - } - VirtualKeyCode::Numpad1 | VirtualKeyCode::Key1 | VirtualKeyCode::B => { - try_move_player(-1, 1, &mut gs.ecs) - } + VirtualKeyCode::Numpad9 + | VirtualKeyCode::Key9 + | VirtualKeyCode::Y + | VirtualKeyCode::W => try_move_player(1, -1, &mut gs.ecs), + + VirtualKeyCode::Numpad7 + | VirtualKeyCode::Key7 + | VirtualKeyCode::U + | VirtualKeyCode::Q => try_move_player(-1, -1, &mut gs.ecs), + + VirtualKeyCode::Numpad3 + | VirtualKeyCode::Key3 + | VirtualKeyCode::N + | VirtualKeyCode::S => try_move_player(1, 1, &mut gs.ecs), + + VirtualKeyCode::Numpad1 + | VirtualKeyCode::Key1 + | VirtualKeyCode::B + | VirtualKeyCode::A => try_move_player(-1, 1, &mut gs.ecs), // Skip Turn - VirtualKeyCode::Numpad5 | VirtualKeyCode::Key5 | VirtualKeyCode::Space => return skip_turn(&mut gs.ecs), + VirtualKeyCode::Numpad5 | VirtualKeyCode::Key5 | VirtualKeyCode::Space => { + return skip_turn(&mut gs.ecs) + } // Level changes VirtualKeyCode::Period => {