From 304a37c326405fe4b0869ac0ea7beee9bbba439e Mon Sep 17 00:00:00 2001 From: Skullheadx <94652084+Skullheadx@users.noreply.github.com> Date: Thu, 23 Nov 2023 23:08:57 -0500 Subject: [PATCH] Update particle.py --- particle.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/particle.py b/particle.py index ae762e2..f1c6f24 100644 --- a/particle.py +++ b/particle.py @@ -10,6 +10,7 @@ class PointParticle: BLUE = (0, 153, 255) RED = (255, 43, 0) + step_amount = 10 def __init__(self, position, charge=1.6e-19): self.position = pygame.Vector2(position) @@ -24,7 +25,7 @@ class PointParticle: self.field_line_angles = list(range(0, 360, int(360 / self.num_field_lines))) # List of angles self.field_lines = [[] for _ in range(self.num_field_lines)] - self.line_step = pygame.Vector2(10, 0) if self.charge > 0 else pygame.Vector2(-10, 0) + self.line_step = pygame.Vector2(self.step_amount, 0) if self.charge > 0 else pygame.Vector2(-self.step_amount, 0) def update(self, delta, particles): if self.dragging or not (True in [p.dragging for p in particles]): @@ -64,7 +65,7 @@ class PointParticle: direction = math.atan2(electric_field_y_net, electric_field_x_net) self.field_lines[field_line_index].append(position.copy()) - if end == True: + if end: break def draw(self, surf): -- 2.54.0