Difficulty that escalated a bit more
authorJustin Worthe <justin@worthe-it.co.za>
Tue, 12 Jun 2018 20:40:37 +0000 (22:40 +0200)
committerJustin Worthe <justin@worthe-it.co.za>
Tue, 12 Jun 2018 20:40:37 +0000 (22:40 +0200)
src/main.rs

index 88f0a2c..a4b3181 100644 (file)
@@ -59,7 +59,14 @@ impl App<AssetId> 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<AssetId> 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 {