Fixed next level msg

master
David Raison 2014-08-31 01:38:26 +02:00
parent af9c1de586
commit f11f6f3c2e
3 changed files with 12 additions and 10 deletions

View File

@ -76,8 +76,8 @@ class Avocado:
def exists(self): def exists(self):
# return not self.has_been_pinned and self.is_still_falling return not self.has_been_pinned and self.is_still_falling
return self.is_still_falling # return self.is_still_falling
def isPinned(self): def isPinned(self):
@ -100,7 +100,7 @@ class Avocado:
def hasLanded(self): def hasLanded(self):
if self.rect.bottom > self.screen_height or self.rect.top < 0: if self.rect.bottom > self.screen_height or self.rect.top < 0:
self.is_still_falling = False self.is_still_falling = False
print('DEBUG :: splatsh!') print('DEBUG :: splash!')
return True return True

View File

@ -15,8 +15,9 @@ class Crystal:
self.imageCenterX = self.screen.get_rect().centerx self.imageCenterX = self.screen.get_rect().centerx
self.imageCenterY = self.screen.get_rect().centery 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): def setColor(self, color):
""" Announces the color to pin by drawing a rectangle self.color = color
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))

View File

@ -121,6 +121,7 @@ class TheGame:
# Initial color indication # Initial color indication
color = self.chooseRandomColor() color = self.chooseRandomColor()
crystalBall.setColor(color)
# We could use this list for redrawing only this part # We could use this list for redrawing only this part
# of the screen install of all of it # of the screen install of all of it
@ -134,11 +135,12 @@ class TheGame:
# Redraw the background and put our lawyer back on top # Redraw the background and put our lawyer back on top
self.drawBackground() self.drawBackground()
crystalBall.blitme()
# Next level? # Next level?
if (score * level) >= (targetScore * level): if score >= (targetScore * level):
level += 1 level += 1
levelChange = 35 levelChange = 70
timeleft = time timeleft = time
avocados = [] avocados = []
print('DEBUG :: Score: ' + str(score)) print('DEBUG :: Score: ' + str(score))
@ -159,7 +161,6 @@ class TheGame:
# Redraw the HUD # Redraw the HUD
the_hud.draw_hud(score, displaytime, round(fps, 2)) the_hud.draw_hud(score, displaytime, round(fps, 2))
crystalBall.setColor(color)
# If we're not currently in between levels… # If we're not currently in between levels…
if levelChange == 0: if levelChange == 0: