From 17e6b5c17c9802b828fba1c5446a426d854a94c8 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 15 Nov 2021 11:06:17 -0600 Subject: [PATCH] Game gets more difficult as you continue --- src/index.html | 5 +++-- src/main.rs | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.html b/src/index.html index ba83197..42c7a74 100644 --- a/src/index.html +++ b/src/index.html @@ -13,8 +13,9 @@ diff --git a/src/main.rs b/src/main.rs index 6bd870a..de0d543 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use bracket_lib::prelude::*; use std::collections::VecDeque; +const VERSION: &str = "0.3.0"; const SCREEN_WIDTH: u16 = 80; const SCREEN_HEIGHT: u16 = 50; const FRAME_DURATION: f32 = 35.0; @@ -21,12 +22,10 @@ struct Obstacle { impl Obstacle { fn new(x: i32, score: u32) -> Self { let mut random = RandomNumberGenerator::new(); - // TODO: make smaller with score Obstacle { x, gap_y: random.range(10, 40), - // TODO: increase difficulty - gap_height: u16::max(2, 15), + gap_height: u16::max(5, 20 - (score as u16 / 3)), } }