diff options
author | tom barrett <spalf0@gmail.com> | 2018-02-27 09:00:56 -0600 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-02-27 09:00:56 -0600 |
commit | b0f25a0a8e2080153794ada6a99f176911f5e43c (patch) | |
tree | d467a5a102f010cb66477393fab7ef892c950893 | |
parent | bd39a5f5bf71e10a73dafb98c5f8ec88aa3bc7fa (diff) |
-astroids moving slowly
-rw-r--r-- | src/astroid.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/astroid.rs b/src/astroid.rs index 28009ca..077c5bf 100644 --- a/src/astroid.rs +++ b/src/astroid.rs @@ -19,14 +19,16 @@ impl Astroid { .gen_ascii_chars() .take(8) .collect(); - let mut r = Range::new(-50.0, 50.0); + let mut pr = Range::new(-50.0, 50.0); + let mut vr = Range::new(-5.0, 5.0); let mut rng = rand::thread_rng(); - let position = (r.sample(&mut rng), r.sample(&mut rng), r.sample(&mut rng)); + let position = (pr.sample(&mut rng), pr.sample(&mut rng), pr.sample(&mut rng)); + let velocity = (vr.sample(&mut rng), vr.sample(&mut rng), vr.sample(&mut rng)); Astroid { name : name, t : Type::Astroid, position : position, - velocity : (0.0, 0.0, 0.0), + velocity : velocity, } } } |