diff --git a/avocado.py b/avocado.py index ee38deb..ea5ae8f 100644 --- a/avocado.py +++ b/avocado.py @@ -7,6 +7,7 @@ class Avocado: def __init__(self, screen, color, filename='img/AvoCado_0.png'): print('New avocado is ' + ','.join(str(color))) + self.screen = screen self.screen_width, self.screen_height = screen.get_size() self.x = random.randint(0, self.screen_width) self.y = 0 # change this to start somewhere above the screen @@ -16,15 +17,14 @@ class Avocado: self.image = pygame.transform.scale(self.i, (30, 30)) self.pycard = self.image.get_rect() - self.pycard.x = random.randint(0, self.screen_width) - self.pycard.y = random.randint(20, 70) + self.init_pos() self.step_x = 10 self.step_y = 10 self.is_falling = True - def reset(self): + def init_pos(self): self.pycard.x = random.randint(0, self.screen_width) - self.pycard.y = random.randint(0, 50) + self.pycard.y = random.randint(20, 70) def collides(self, click): """ diff --git a/game.py b/game.py index 9704cdb..b8e66ea 100755 --- a/game.py +++ b/game.py @@ -40,6 +40,7 @@ def main(): # initialize the HUD class and the lawyer the_hud = hud.Hud(screen) fullegast = lawyer.Lawyer(screen) + # Well, we want this to select between several colors, so we need a list # of colors, right? colors = [BLUE, GREEN, RED, YELLOW] @@ -85,7 +86,7 @@ def main(): for a in avocados: if not a.move(): - a.reset() + a.init_pos() screen.blit(a.image, a.pycard) # Catch events diff --git a/img/AvoCado_1.png b/img/AvoCado_1.png index 45f535e..f238e62 100644 Binary files a/img/AvoCado_1.png and b/img/AvoCado_1.png differ diff --git a/img/splashScreen.png b/img/splashScreen.png new file mode 100644 index 0000000..6f46d9f Binary files /dev/null and b/img/splashScreen.png differ