From fd5b4f77a6254d3ab665f38a80eb2d4647bd2609 Mon Sep 17 00:00:00 2001 From: yosiasm Date: Sun, 6 Oct 2019 18:23:51 +0700 Subject: [PATCH] add more mob when score increase --- spaceshooter/spaceShooter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spaceshooter/spaceShooter.py b/spaceshooter/spaceShooter.py index 2a3fae2..18826a3 100644 --- a/spaceshooter/spaceShooter.py +++ b/spaceshooter/spaceShooter.py @@ -494,7 +494,7 @@ def update(self): ## now as we delete the mob element when we hit one with a bullet, we need to respawn them again ## as there will be no mob_elements left out for hit in hits: - score += 50 - hit.radius ## give different scores for hitting big and small metoers + score += 50 - hit.radius -int(score/3000 ) ## give different scores for hitting big and small metoers random.choice(expl_sounds).play() # m = Mob() # all_sprites.add(m) @@ -505,7 +505,8 @@ def update(self): pow = Pow(hit.rect.center) all_sprites.add(pow) powerups.add(pow) - newmob() ## spawn a new mob + for m in range(int(1+score/3000)): + newmob() ## spawn a new mob ## ^^ the above loop will create the amount of mob objects which were killed spawn again #########################