]> Skullheadx's Git Forge - fruit-ninja.git/commitdiff
gray shades
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Fri, 2 Jun 2023 16:31:37 +0000 (12:31 -0400)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Fri, 2 Jun 2023 16:31:37 +0000 (12:31 -0400)
fruit.py
setup.py

index fd0cf71603392d95e4f2f95dc4bd577582b91010..4ab6de77c9442a0173034e6fdf0e0cc164a1f354 100644 (file)
--- 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)
index 0013c8d6c873c3f0d820461d36a217f83731941a..95f9c358ea065ca96ab4d6fa0132695ec860be1e 100644 (file)
--- 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)