diff --git a/avocado.py b/avocado.py index c7eb467..4e9da39 100644 --- a/avocado.py +++ b/avocado.py @@ -76,8 +76,8 @@ class Avocado: def exists(self): - # return not self.has_been_pinned and self.is_still_falling - return self.is_still_falling + return not self.has_been_pinned and self.is_still_falling + # return self.is_still_falling def isPinned(self): @@ -100,7 +100,7 @@ class Avocado: def hasLanded(self): if self.rect.bottom > self.screen_height or self.rect.top < 0: self.is_still_falling = False - print('DEBUG :: splatsh!') + print('DEBUG :: splash!') return True diff --git a/crystal.py b/crystal.py index d7c0aaf..636b05b 100644 --- a/crystal.py +++ b/crystal.py @@ -15,8 +15,9 @@ class Crystal: self.imageCenterX = self.screen.get_rect().centerx self.imageCenterY = self.screen.get_rect().centery + def blitme(self): + pygame.draw.ellipse(self.screen, self.color, (self.imageCenterX-158,self.imageCenterY-5,277,217), 0) + def setColor(self, color): - """ Announces the color to pin by drawing a rectangle - and filling it with a color """ - pygame.draw.ellipse(self.screen, (color), (self.imageCenterX-158,self.imageCenterY-5,277,217), 0) - print("Drawing {} ellipse".format(color)) + self.color = color + diff --git a/game.py b/game.py index 7908dc1..c7c4f6f 100755 --- a/game.py +++ b/game.py @@ -121,6 +121,7 @@ class TheGame: # Initial color indication color = self.chooseRandomColor() + crystalBall.setColor(color) # We could use this list for redrawing only this part # of the screen install of all of it @@ -134,11 +135,12 @@ class TheGame: # Redraw the background and put our lawyer back on top self.drawBackground() + crystalBall.blitme() # Next level? - if (score * level) >= (targetScore * level): + if score >= (targetScore * level): level += 1 - levelChange = 35 + levelChange = 70 timeleft = time avocados = [] print('DEBUG :: Score: ' + str(score)) @@ -159,7 +161,6 @@ class TheGame: # Redraw the HUD the_hud.draw_hud(score, displaytime, round(fps, 2)) - crystalBall.setColor(color) # If we're not currently in between levels… if levelChange == 0: