@@ -27,12 +27,12 @@ def draw(self):
27
27
pygame .draw .circle (screen , BLACK , (int (self .position [0 ]), int (self .position [1 ])), int (self .radius ))
28
28
pygame .draw .circle (screen , WHITE , (int (self .position [0 ]), int (self .position [1 ])), int (self .radius ), width = 10 )
29
29
d = 60 - clock .get_fps ()
30
- if d > 2 :
30
+ if d > 7.5 :
31
31
self .radius += d * 1.5
32
32
else :
33
- self .radius += 2
33
+ self .radius += 5
34
34
35
- if self .radius > 2250 :
35
+ if self .radius > 2210 :
36
36
self .do_wipe = False
37
37
self .radius = 0
38
38
@@ -47,7 +47,7 @@ def __init__(self, x, y, size=1, vx=0, vy=0):
47
47
self .mass = size # Mass is proportional to size
48
48
color = pmma .ColorConverter ()
49
49
self .color = color .generate_random_color (format = pmma .Constants .RGB )
50
- self .explosion_size = random .randint (100 , 250 )
50
+ self .explosion_size = random .randint (250 , 750 )
51
51
52
52
def move (self ):
53
53
self .x += self .vx
@@ -62,13 +62,13 @@ def move(self):
62
62
def draw (self , screen ):
63
63
pygame .draw .circle (screen , self .color , (int (self .x ), int (self .y )), self .size )
64
64
65
- def attract (self , other , G = 0.5 ):
65
+ def attract (self , other , G = 1 ):
66
66
# Calculate distance and direction
67
67
dx = other .x - self .x
68
68
dy = other .y - self .y
69
69
distance = math .sqrt (dx ** 2 + dy ** 2 )
70
70
71
- if distance > 0 and distance < 1920 : # Limit the interaction range
71
+ if distance > 0 : # Limit the interaction range
72
72
force = G * (self .mass * other .mass ) / distance ** 2
73
73
fx = force * (dx / distance )
74
74
fy = force * (dy / distance )
@@ -132,13 +132,13 @@ def combine(self, other):
132
132
p1 .move ()
133
133
p1 .draw (screen )
134
134
135
- if p1 .mass > 100 :
135
+ if p1 .mass > p1 . explosion_size :
136
136
particles .remove (p1 )
137
137
# Explosion logic
138
138
num_new_particles = int (p1 .explosion_size / 3 ) # Number of smaller particles
139
139
for _ in range (num_new_particles ):
140
140
angle = random .uniform (0 , 2 * math .pi ) # Random angle for direction
141
- speed = random .uniform (1 , 3 ) # Speed of the smaller particles
141
+ speed = random .uniform (5 , 7 ) # Speed of the smaller particles
142
142
new_vx = math .cos (angle ) * speed
143
143
new_vy = math .sin (angle ) * speed
144
144
particles .append (Particle (p1 .x + 20 * math .cos (angle ), p1 .y + 20 * math .sin (angle ), size = random .randint (1 , 5 ), vx = new_vx , vy = new_vy ))
0 commit comments