]> Skullheadx's Git Forge - fruit-ninja.git/commitdiff
clean up + remove debug hud
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Sat, 3 Jun 2023 00:23:50 +0000 (20:23 -0400)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Sat, 3 Jun 2023 00:23:50 +0000 (20:23 -0400)
game.py
main.py
setup.py

diff --git a/game.py b/game.py
index bc80650cc70b2d4ac6ff4f7c48bb5a7d72ea4ebc..00cd5bc7a822f080563b2f05c5b3287d4877ad9c 100644 (file)
--- a/game.py
+++ b/game.py
@@ -82,7 +82,9 @@ class Game:
             bomb.update(delta)
             if self.player.hits(bomb):
                 for i in range(self.EFFECT_COUNT_PER_BOMB):
-                    self.effects.append(Effect(bomb.position + pygame.Vector2(random.random(), random.random()), bomb.radius, WHITE, darken=False))
+                    self.effects.append(
+                        Effect(bomb.position + pygame.Vector2(random.random(), random.random()), bomb.radius, WHITE,
+                               darken=False))
 
                 bomb.explode(self.fruits, self.bombs, self.effects)
                 self.game_over = True
@@ -110,7 +112,13 @@ class Game:
         for combo in self.combo_counters:
             combo.draw(surf)
         self.player.draw(surf)
-        text_surf = font.render(str(self.score), True, BLACK)
-        surf.blit(text_surf, (WIDTH - text_surf.get_width(), 0))
-        text_surf2 = font.render(f"TIME SINCE LAST HIT {round(self.time_since_last_hit / 1000, 1)}", True, BLACK)
-        surf.blit(text_surf2, (WIDTH - text_surf2.get_width(), text_surf.get_height()))
+        text_surf = font.render(f"SCORE {self.score}", True, WHITE)
+        surf.blit(text_surf, (0, 0))
+        # text_surf2 = font.render(f"COMBO {self.current_combo}", True, WHITE)
+        # surf.blit(text_surf2, (0, text_surf.get_height()))
+        # text_surf2 = font.render(f"TIME SINCE LAST HIT {round(self.time_since_last_hit / 1000, 1)}", True, BLACK)
+        # surf.blit(text_surf2, (WIDTH - text_surf2.get_width(), text_surf.get_height()))
+
+        if self.game_over:
+            game_over_surf = font_large.render("GAME OVER", True, WHITE)
+            surf.blit(game_over_surf, game_over_surf.get_rect(center=(WIDTH / 2, HEIGHT / 2.5)))
diff --git a/main.py b/main.py
index 86c1e386cc30151a7ece3f3677bb606cb52c24bd..752a73cbd254f4d7ed6a5f3b8471d6cf56a5d2f7 100644 (file)
--- a/main.py
+++ b/main.py
@@ -11,7 +11,6 @@ while is_running:
     delta = clock.tick(FPS)
     status = scene.update(delta)
     scene.draw(screen)
-    screen.blit(font.render(f"FPS: {clock.get_fps():.2f}", True, BLACK), (0, 0))
     pygame.display.update()
 
     if status == COMMAND_EXIT:
index 2bdc58abffd9e0550c2b4e7e9e8ff08ce7afcc94..6f33c1d5546545a464edf02e8234f6f503b2d363 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,6 @@ DARKEN = {RED: DARK_RED, ORANGE: DARK_ORANGE, YELLOW: DARK_YELLOW, GREEN: DARK_G
 # commands
 COMMAND_EXIT = 0
 COMMAND_START = 1
-COMMAND_GAME_OVER = 2
 
 
 def lerp(start, end, weight):