Skip to content

Commit

Permalink
Wire up TRAIL_LENGTH again
Browse files Browse the repository at this point in the history
  • Loading branch information
lordmauve committed Apr 16, 2019
1 parent ae14529 commit 6bf9bf7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/basic/stars.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
HEIGHT = 1000 * 9 // 16
ACCEL = 1.0 # Warp factor per second
DRAG = 0.71 # Fraction of speed per second
TRAIL_LENGTH = 3
TRAIL_LENGTH = 2
MIN_WARP_FACTOR = 0.1
BOUNDS = Rect(0, 0, WIDTH, HEIGHT)

Expand Down Expand Up @@ -35,8 +35,8 @@ def end_pos(self):
vx, vy = self.vel

return (
x - vx * warp_factor / 30,
y - vy * warp_factor / 30,
x - vx * warp_factor * TRAIL_LENGTH / 60,
y - vy * warp_factor * TRAIL_LENGTH / 60,
)


Expand Down Expand Up @@ -87,7 +87,7 @@ def update(dt):
# Turn the direction into position and velocity vectors
dx = math.cos(angle)
dy = math.sin(angle)
d = random.uniform(25, 100)
d = random.uniform(25 + TRAIL_LENGTH, 100)
pos = centerx + dx * d, centery + dy * d
vel = speed * dx, speed * dy

Expand Down

0 comments on commit 6bf9bf7

Please sign in to comment.