From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Fri, 2 Jun 2023 16:31:37 +0000 (-0400) Subject: gray shades X-Git-Tag: game~20 X-Git-Url: http://git.skullheadx.com/sitemap.xml?a=commitdiff_plain;h=89bdf13505b663c1d0b214b59ccbfcde887cda26;p=fruit-ninja.git gray shades --- diff --git a/fruit.py b/fruit.py index fd0cf71..4ab6de7 100644 --- a/fruit.py +++ b/fruit.py @@ -28,6 +28,8 @@ class Fruit: lerp(self.VERTICAL_SPAWN_RANGE[0], self.VERTICAL_SPAWN_RANGE[1], random.random())) self.acceleration = pygame.Vector2(0, self.GRAVITY) + # self.previous_position = self.position + dy = self.target.y - self.position.y dx = self.target.x - self.position.x t = (-2 / self.GRAVITY * dy) ** 0.5 @@ -36,6 +38,7 @@ class Fruit: self.color = random.choice(self.COLORS) def update(self, delta): + # self.previous_position = self.position.copy() - self.velocity / 1000 * 30 self.velocity += self.acceleration * delta / 1000 self.position += self.velocity * delta / 1000 @@ -44,7 +47,10 @@ class Fruit: pygame.Vector2(self.radius, self.radius)) def draw(self, surf): + # pygame.draw.circle(surf, DARK_GRAY, self.previous_position, self.radius) + pygame.draw.circle(surf, self.color, self.position, self.radius) pygame.draw.circle(surf, DARKEN[self.color], self.position, self.radius, self.OUTLINE_WIDTH) + # pygame.draw.circle(surf, BLACK, self.target, 10) diff --git a/setup.py b/setup.py index 0013c8d..95f9c35 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,9 @@ pygame.display.set_caption("Fruit Ninja") # colors WHITE = (255, 255, 255) +LIGHT_GRAY = (211, 211, 211) +GRAY = (128, 128, 128) +DARK_GRAY = (25,25,25) BLACK = (0, 0, 0) RED = (255, 0, 0)