diff --git a/Main.py b/Main.py index 0a2d68e..e97e1e8 100644 --- a/Main.py +++ b/Main.py @@ -281,6 +281,18 @@ class MyGame(arcade.Window): if self.alienCounterY < 0: # Reset the X and Y counter variables self.alienCounterY = len(self.aliens) - 1 + if self.alienCounterY < 0: + # Reset the X and Y counter variables + self.alienCounterY = len(self.aliens) - 1 + if self.alienCounterY < 0: + # Reset the X and Y counter variables + self.alienCounterY = len(self.aliens) - 1 + if self.alienCounterY < 0: + # Reset the X and Y counter variables + self.alienCounterY = len(self.aliens) - 1 + if self.alienCounterY < 0: + # Reset the X and Y counter variables + self.alienCounterY = len(self.aliens) - 1 self.alienCounterX = 0 # Alien Movement if self.Won == False: @@ -344,7 +356,7 @@ class MyGame(arcade.Window): self.alienChangeDir = 0 # if DEBUG: # print(e) - if len(self.aliens) == 0: + if len(self.aliens) < 1 : self.Won = True # except Exception as e: # if DEBUG: @@ -353,8 +365,9 @@ class MyGame(arcade.Window): print("You Won!") sys.exit() # Check to see if any aliens are colliding with a player's bullet - for alienRow in self.aliens: - if alienRow == []: + for index, alienRow in enumerate(self.aliens): + length = len(self.aliens) + if alienRow == [] and index == length - 1 and length > 0: self.aliens.remove(alienRow) for alien in alienRow: try: