]> Skullheadx's Git Forge - fruit-ninja.git/commitdiff
clean up
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Fri, 2 Jun 2023 23:45:46 +0000 (19:45 -0400)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Fri, 2 Jun 2023 23:45:46 +0000 (19:45 -0400)
bomb.py
game.py

diff --git a/bomb.py b/bomb.py
index 3d7e49a3ae064e9f01a5b3ad9d24d2eddc7523db..0af48a649d0495017cf97dbd9a2fa9d7d5ae4a03 100644 (file)
--- a/bomb.py
+++ b/bomb.py
@@ -1,5 +1,5 @@
-from setup import *
 from fruit import Fruit
+from setup import *
 
 
 class Bomb(Fruit):
@@ -25,8 +25,6 @@ class Bomb(Fruit):
         self.velocity = pygame.Vector2(0, 0)
         self.acceleration = pygame.Vector2(0, 0)
 
-
-
         for fruit in fruits:
             fruit.velocity += (fruit.position - self.position).normalize() * self.POWER
         for bomb in bombs:
@@ -35,7 +33,9 @@ class Bomb(Fruit):
 
     def draw(self, surf):
         if self.exploded:
-            pygame.draw.circle(surf, DARK_RED, self.position, clamp(self.RADIUS + self.exploded_time / 1000 * 100, 0, 300))
-            pygame.draw.circle(surf, BLACK, self.position, clamp(self.RADIUS + self.exploded_time / 1000 * 100, 0, 300), self.OUTLINE_WIDTH)
+            pygame.draw.circle(surf, DARK_RED, self.position,
+                               clamp(self.RADIUS + self.exploded_time / 1000 * 100, 0, 300))
+            pygame.draw.circle(surf, BLACK, self.position, clamp(self.RADIUS + self.exploded_time / 1000 * 100, 0, 300),
+                               self.OUTLINE_WIDTH)
         else:
             pygame.draw.circle(surf, BLACK, self.position, self.RADIUS)
diff --git a/game.py b/game.py
index 552b246528819528e5c2b5c1ffe984fae9da0c0c..474e3d63852aa749e917dd83e8d0b043a2afd234 100644 (file)
--- a/game.py
+++ b/game.py
@@ -1,9 +1,9 @@
-from setup import *
-from player import Player
-from fruit import Fruit
 from bomb import Bomb
-from effect import Effect
 from combo_counter import ComboCounter
+from effect import Effect
+from fruit import Fruit
+from player import Player
+from setup import *
 
 
 class Game:
@@ -11,13 +11,14 @@ class Game:
     EFFECT_COUNT_PER_FRUIT = 20
     COMBO_TIME = 250
     GAME_OVER_TIME = 1000
+
     def __init__(self):
         self.player = Player()
         self.fruits = [Fruit()]
         self.bombs = []
         self.effects = []
         self.combo_counters = []
-        self.wave = 100
+        self.wave = 1
         self.score = 0
         self.time_since_last_hit = 0
         self.current_combo = 0
@@ -62,7 +63,7 @@ class Game:
             if self.time_since_last_hit < self.COMBO_TIME:
                 self.current_combo += 1
                 if self.current_combo > 1:
-                    self.combo_counters.append(ComboCounter(hit.position, f"x{self.current_combo+1}"))
+                    self.combo_counters.append(ComboCounter(hit.position, f"x{self.current_combo + 1}"))
 
             self.time_since_last_hit = 0