increased avocado size

master
David Raison 2014-08-30 20:55:40 +02:00
parent fdae2d2c07
commit 85a79e07af
2 changed files with 5 additions and 5 deletions

View File

@ -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()

View File

@ -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: