Merge branch 'master' of github.com:lvl2/avocados
commit
df20b93cc3
|
@ -7,15 +7,6 @@ class Avocado:
|
||||||
|
|
||||||
def __init__(self, screen, color, size, target, filename='img/AvoCado_0.png'):
|
def __init__(self, screen, color, size, target, filename='img/AvoCado_0.png'):
|
||||||
|
|
||||||
# HELP please!!
|
|
||||||
# We randomly decide whether we should instanciate or not
|
|
||||||
# I'd rather just not return an instance,
|
|
||||||
# but I don't know how to do that :(
|
|
||||||
if random.randint(0,40) != 1:
|
|
||||||
self.is_still_falling = False
|
|
||||||
self.has_been_pinned = False
|
|
||||||
return None
|
|
||||||
|
|
||||||
# Set up our instance variables
|
# Set up our instance variables
|
||||||
self.screen = screen
|
self.screen = screen
|
||||||
self.color = color
|
self.color = color
|
||||||
|
|
3
game.py
3
game.py
|
@ -168,7 +168,8 @@ class TheGame:
|
||||||
avocados_in_game = len(avocados)
|
avocados_in_game = len(avocados)
|
||||||
avocadosWanted = level * multiplier
|
avocadosWanted = level * multiplier
|
||||||
if avocados_in_game < avocadosWanted:
|
if avocados_in_game < avocadosWanted:
|
||||||
for i in range(avocados_in_game, avocadosWanted):
|
blah = int(1.0/(avocadosWanted - avocados_in_game) * 100)
|
||||||
|
if random.randint(0, blah) == 1:
|
||||||
avocolor = self.chooseRandomColor()
|
avocolor = self.chooseRandomColor()
|
||||||
avosize = (50, 50) # should we randomize this?
|
avosize = (50, 50) # should we randomize this?
|
||||||
a = avocado.Avocado(self.screen, avocolor, avosize, color)
|
a = avocado.Avocado(self.screen, avocolor, avosize, color)
|
||||||
|
|
Loading…
Reference in New Issue