increased avocado size
parent
fdae2d2c07
commit
85a79e07af
|
@ -5,18 +5,17 @@ from support import operations
|
||||||
|
|
||||||
class Avocado:
|
class Avocado:
|
||||||
|
|
||||||
def __init__(self, screen, color, filename='img/AvoCado_0.png'):
|
def __init__(self, screen, color, size, filename='img/AvoCado_0.png'):
|
||||||
print('New avocado is ' + ','.join(str(color)))
|
print('New avocado is ' + ','.join(str(color)))
|
||||||
self.screen = screen
|
self.screen = screen
|
||||||
self.screen_width, self.screen_height = screen.get_size()
|
self.screen_width, self.screen_height = screen.get_size()
|
||||||
self.x = random.randint(0, self.screen_width)
|
self.x = random.randint(0, self.screen_width)
|
||||||
self.y = 0 # change this to start somewhere above the screen
|
self.y = 0 # change this to start somewhere above the screen
|
||||||
self.w = 100
|
self.w , self.y = size
|
||||||
self.y = 100
|
|
||||||
|
|
||||||
self.i = pygame.image.load(filename).convert_alpha()
|
self.i = pygame.image.load(filename).convert_alpha()
|
||||||
operations.color_surface(self.i, color)
|
operations.color_surface(self.i, color)
|
||||||
self.image = pygame.transform.scale(self.i, (30, 30))
|
self.image = pygame.transform.scale(self.i, (self.w, self.y))
|
||||||
self.pycard = self.image.get_rect()
|
self.pycard = self.image.get_rect()
|
||||||
|
|
||||||
self.init_pos()
|
self.init_pos()
|
||||||
|
|
3
game.py
3
game.py
|
@ -81,7 +81,8 @@ def main():
|
||||||
avocados = []
|
avocados = []
|
||||||
for i in range(0, level):
|
for i in range(0, level):
|
||||||
color = colors[random.randint(0,3)]
|
color = colors[random.randint(0,3)]
|
||||||
a = avocado.Avocado(screen, color)
|
avosize = (60,60) # should we randomize this?
|
||||||
|
a = avocado.Avocado(screen, color, avosize)
|
||||||
avocados.append(a)
|
avocados.append(a)
|
||||||
|
|
||||||
for a in avocados:
|
for a in avocados:
|
||||||
|
|
Loading…
Reference in New Issue