diff options
author | tom barrett <spalf0@gmail.com> | 2018-02-27 06:59:58 -0600 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-02-27 06:59:58 -0600 |
commit | b5896e2d7597e42818a47710da22098d178bf8f6 (patch) | |
tree | d48107628b0c10fc41493e35f8ba8f3039c3b9bc /src/bin | |
parent | 87346ea9b91d441e92c476785c2cb979f9a23bf5 (diff) |
-now use velocity and position vector, astroids are now randomly populated
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/server.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/server.rs b/src/bin/server.rs index c327257..36840c1 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -11,7 +11,9 @@ use space::connection::Connection; fn populate() -> Vec<Box<Mass>> { let mut masses : Vec<Box<Mass>> = Vec::new(); - masses.push(Box::new(Astroid::new("cZfAJ", (10.0, -5.0, 4.0)))); + masses.push(Box::new(Astroid::new())); + masses.push(Box::new(Astroid::new())); + masses.push(Box::new(Astroid::new())); masses } @@ -32,6 +34,10 @@ fn main() { } connections.retain(|connection| connection.open); + for mass in masses.iter_mut() { + mass.process(); + } + sleep(Duration::from_millis(100)); } } |