-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticles.py
More file actions
34 lines (29 loc) · 861 Bytes
/
Copy pathParticles.py
File metadata and controls
34 lines (29 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from Particle import Particle
from Colors import *
class Electron(Particle) :
def __init__(self, x, y):
self.color = BLUE
self.colors = [BLUE, WHITE]
self.radius = 3
self.electric_charge = -1
self.is_nucleon = False
self.mass = 1
super().__init__(x, y)
class Proton(Particle) :
def __init__(self, x, y):
self.color = RED
self.colors = [RED, ORANGE]
self.radius = 6
self.electric_charge = +1
self.is_nucleon = True
self.mass = 10
super().__init__(x, y)
class Neutron(Particle) :
def __init__(self, x, y):
self.color = DARK_GRAY
self.colors = [DARK_GRAY, LIGHT_GRAY]
self.radius = 5
self.electric_charge = 0
self.is_nucleon = True
self.mass = 8
super().__init__(x, y)