From 5967359e7087a4ace28d93718f5ee6cb1e3dcfcd Mon Sep 17 00:00:00 2001 From: William Hubbard <75867393+Markil3@users.noreply.github.com> Date: Sun, 5 Feb 2023 10:30:42 -0700 Subject: [PATCH] Refines the difficulty curve. --- artrepository.py | 5 +++-- sprites.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/artrepository.py b/artrepository.py index dea42f2..b77bb25 100644 --- a/artrepository.py +++ b/artrepository.py @@ -122,7 +122,8 @@ bigdoritoobstacle = SpriteImage( ) # BITMAP: width: 16, height: 16 leaf = SpriteImage( - bytearray([128,1,1,1,3,3,3,71,135,15,15,31,63,255,255,255,255,254,252,248,240,240,224,224,192,193,194,196,200,144,1,63]), + bytearray([127,254,254,254,252,252,252,184,120,240,240,224,192,0,0,0, + 0,1,3,7,15,15,31,31,63,62,61,59,55,111,254,192]), None, 16, 16 @@ -174,4 +175,4 @@ Doritoobstaclelvl5 = SpriteImage( 30 ) -OBSTACLES = [skull, pizza, boulder, ball, steve, mathroot, robot, dinoskull, dinojaw, dinospine, bone, bigdinohead, bigboneddiag, bigdoritoobstacle, spaceinv, leaf,annoydead,lvl4wall,ballobstaclelvl3,Doritoobstaclelvl5] +OBSTACLES = [skull, pizza, boulder, ball, steve, mathroot, leaf, robot, dinoskull, dinojaw, dinospine, bone, bigdinohead, bigboneddiag, bigdoritoobstacle, spaceinv,annoydead,lvl4wall,ballobstaclelvl3,Doritoobstaclelvl5] diff --git a/sprites.py b/sprites.py index b44901f..0d2698c 100644 --- a/sprites.py +++ b/sprites.py @@ -127,9 +127,9 @@ def update_entities(entities, difficulty: int, current_depth: int, prev_depth: i return set() spawned = set() - max_spawned = randrange(0, difficulty + 1) - while len(spawned) < max_spawned and random() < (2 * math.pow(difficulty, 2)) / (3 * math.pow(difficulty, 2) + 20 * difficulty): - sprite_image = OBSTACLES[randrange(0, len(OBSTACLES))] + max_spawned = 1#randrange(0, difficulty + 1) + while len(spawned) < max_spawned and random() < (2 * math.pow(difficulty + 0.01, 2)) / (3 * math.pow(difficulty + 0.01, 2) + 20 * (difficulty + 0.01)) + 0.05: + sprite_image = OBSTACLES[randrange(0, min((difficulty + 1) * 3, len(OBSTACLES)))] if sprite_image.width >= thumby.display.width: x = 0 else: