Merge branch 'dev' of gitea.tforgione.fr:free-rusty-maker/free-rusty-maker into dev

This commit is contained in:
Thomas Forgione 2018-11-19 15:21:09 +01:00
commit a8f928f488
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 0 additions and 17 deletions

View File

@ -94,18 +94,12 @@ pub struct KeyboardMap {
/// The key corresponding to the run button.
run_key: Key,
/// The key corresponding to the up button.
up_key: Key,
/// The key corresponding to the left button.
left_key: Key,
/// The key corresponding to the right button.
right_key: Key,
/// The key corresponding to the down button.
down_key: Key,
}
impl KeyboardMap {
@ -115,10 +109,8 @@ impl KeyboardMap {
KeyboardMap {
jump_key: Key::Space,
run_key: Key::LAlt,
up_key: Key::Up,
left_key: Key::Left,
right_key: Key::Right,
down_key: Key::Down,
}
}
@ -143,7 +135,6 @@ impl KeyboardMap {
let mut ret = Vector2::new(0.0, 0.0);
const RIGHT: Vector2<f32> = Vector2 { x: 1.0, y: 0.0 };
const UP: Vector2<f32> = Vector2 {x: 0.0, y: 1.0};
if self.right_key.is_pressed() {
ret += RIGHT;
@ -153,14 +144,6 @@ impl KeyboardMap {
ret -= RIGHT;
}
if self.up_key.is_pressed() {
ret += UP;
}
if self.down_key.is_pressed() {
ret -= UP;
}
ret
}