From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Fri, 2 Jun 2023 22:43:19 +0000 (-0400) Subject: larger font + inc vel + better text X-Git-Tag: game~17 X-Git-Url: http://git.skullheadx.com/nixos/projects/suckless.html?a=commitdiff_plain;h=3f1a665fb86fd4a1fda7d58eb5e1cc400415273b;p=fruit-ninja.git larger font + inc vel + better text --- diff --git a/combo_counter.py b/combo_counter.py index 31e5d21..cb9eb1a 100644 --- a/combo_counter.py +++ b/combo_counter.py @@ -6,10 +6,10 @@ class ComboCounter: def __init__(self, position, combo): self.position = pygame.Vector2(position) - self.velocity = pygame.Vector2(0, -1) + self.velocity = pygame.Vector2(0, -100) self.time = self.LIFE_TIME self.combo = combo - self.text_surface = font.render(self.combo, True, BLACK) + self.text_surface = font_large.render(self.combo, True, BLACK) def update(self, delta): self.position += self.velocity * delta / 1000 diff --git a/game.py b/game.py index c408ec7..89d62e7 100644 --- a/game.py +++ b/game.py @@ -52,7 +52,8 @@ class Game: self.score += 1 if self.time_since_last_hit < self.COMBO_TIME: self.current_combo += 1 - self.combo_counters.append(ComboCounter(hit.position, str(self.current_combo))) + if self.current_combo > 1: + self.combo_counters.append(ComboCounter(hit.position, f"x{self.current_combo+1}")) self.time_since_last_hit = 0 diff --git a/setup.py b/setup.py index 801367d..2b4b012 100644 --- a/setup.py +++ b/setup.py @@ -44,3 +44,4 @@ def lerp(start, end, weight): font = pygame.font.SysFont("Arial", 50) +font_large = pygame.font.SysFont("Arial", 80) \ No newline at end of file