From dbeffaaac544e56c51f4640fa0113ddbe6e13c8a Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Tue, 12 Jun 2018 22:40:37 +0200 Subject: Difficulty that escalated a bit more --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 88f0a2c..a4b3181 100644 --- a/src/main.rs +++ b/src/main.rs @@ -59,7 +59,14 @@ impl App for BugBasherGame { self.total_time += seconds; if self.time_to_next_bug <= 0. { - let mean = f64::max(4. - (self.total_time as f64 * 0.25), 0.5); + let mean = if self.total_time < 30. { + f64::max(4. - (self.total_time as f64 * 0.2), 1.) + } else if self.total_time < 60. { + f64::max(1. - ((self.total_time as f64 - 30.) * 0.05), 0.5) + } else if self.total_time < 90. { + f64::max(0.5 - ((self.total_time as f64 - 60.) * 0.05), 0.3) + } + let sd = mean / 3.; let time_dist = rand::distributions::Normal::new(mean, sd); self.time_to_next_bug = time_dist.ind_sample(&mut self.rng); @@ -111,7 +118,7 @@ impl App for BugBasherGame { { let mut renderer = renderer.sprite_mode(); renderer.draw( - &Affine::translate(self.home.pos.x, self.home.pos.y), + &Affine::translate(self.home.pos.x, self.home.pos.y).pre_scale(0.5), self.home.sprite ); for bug in &self.bugs { -- cgit v1.2.3