diff options
author | tom barrett <spalf0@gmail.com> | 2018-02-27 07:54:45 -0600 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-02-27 07:54:45 -0600 |
commit | bd39a5f5bf71e10a73dafb98c5f8ec88aa3bc7fa (patch) | |
tree | b358f70323884f528bc294a8b9034f199b39c9c4 /src/connection.rs | |
parent | b5896e2d7597e42818a47710da22098d178bf8f6 (diff) |
-added ability for ships to slow their velocity vector with one keypress
Diffstat (limited to 'src/connection.rs')
-rw-r--r-- | src/connection.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/connection.rs b/src/connection.rs index bcd4a30..8cf2a15 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -68,12 +68,13 @@ impl Connection { let mut data = String::new(); match self.buff_r.read_line(&mut data) { Ok(result) => match data.as_bytes() { - b"5\n" => acceleration.0 += 1.0, - b"0\n" => acceleration.0 -= 1.0, - b"8\n" => acceleration.1 += 1.0, - b"2\n" => acceleration.1 -= 1.0, - b"4\n" => acceleration.2 += 1.0, - b"6\n" => acceleration.2 -= 1.0, + b"5\n" => acceleration.0 += 0.1, + b"0\n" => acceleration.0 -= 0.1, + b"8\n" => acceleration.1 += 0.1, + b"2\n" => acceleration.1 -= 0.1, + b"4\n" => acceleration.2 += 0.1, + b"6\n" => acceleration.2 -= 0.1, + b"-\n" => masses[self.index].slow(), _ => { if result == 0 { self.open = false; |