summaryrefslogtreecommitdiff
path: root/src/ship.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2018-03-13 04:58:12 -0500
committertom barrett <spalf0@gmail.com>2018-03-13 04:58:12 -0500
commit7a4403d2a26250c82b6f089de3b56e076c69e39a (patch)
tree19c77c86b841abfcd93c81d67a1ed4e32e07da72 /src/ship.rs
parent74e1c462f6dfa76243917ef358195f057c236b5d (diff)
-added matching velocity vector of target and creating a velocity vector to target
Diffstat (limited to 'src/ship.rs')
-rw-r--r--src/ship.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ship.rs b/src/ship.rs
index 7eb3ba2..c33dc6c 100644
--- a/src/ship.rs
+++ b/src/ship.rs
@@ -46,6 +46,13 @@ impl Ship {
}
}
+ pub fn speedup(&mut self) {
+ self.velocity.0 *= 1.05;
+ self.velocity.1 *= 1.05;
+ self.velocity.2 *= 1.05;
+
+ }
+
pub fn range(&self) -> f64 {
self.r
}
@@ -82,6 +89,10 @@ impl Mass for Ship {
Box::new((*self).clone())
}
+ fn recv_velocity(&self) -> (f64, f64, f64) {
+ self.velocity
+ }
+
fn give_acceleration(&mut self, acceleration : (f64, f64, f64)) {
self.velocity.0 += acceleration.0;
self.velocity.1 += acceleration.1;