From b0f25a0a8e2080153794ada6a99f176911f5e43c Mon Sep 17 00:00:00 2001 From: tom barrett Date: Tue, 27 Feb 2018 09:00:56 -0600 Subject: -astroids moving slowly --- src/astroid.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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, } } } -- cgit v1.2.3