Skip to content

Commit b4e111f

Browse files
committed
Tweaks
1 parent 8fff057 commit b4e111f

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

atoms.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ def generate_random(previous_atoms):
131131
while True:
132132
x, y = Atom.generate_random_position(co.H_RADIUS)
133133
if all(not atom.isColliding(x, y, co.H_RADIUS) for atom in previous_atoms):
134-
break
134+
if math.dist((x, y), (co.RESTART_BTN_POS_X, co.RESTART_BTN_POS_X)) > co.H_RADIUS + 20:
135+
break
135136
return Hydrogen(x, y)
136137

137138

@@ -144,7 +145,8 @@ def generate_random(previous_atoms):
144145
while True:
145146
x, y = Atom.generate_random_position(co.O_RADIUS)
146147
if all(not atom.isColliding(x, y, co.O_RADIUS) for atom in previous_atoms):
147-
break
148+
if math.dist((x, y), (co.RESTART_BTN_POS_X, co.RESTART_BTN_POS_X)) > co.O_RADIUS + 20:
149+
break
148150
return Oxygen(x, y)
149151

150152

@@ -157,7 +159,8 @@ def generate_random(previous_atoms):
157159
while True:
158160
x, y = Atom.generate_random_position(co.N_RADIUS)
159161
if all(not atom.isColliding(x, y, co.N_RADIUS) for atom in previous_atoms):
160-
break
162+
if math.dist((x, y), (co.RESTART_BTN_POS_X, co.RESTART_BTN_POS_X)) > co.N_RADIUS + 20:
163+
break
161164
return Nitrogen(x, y)
162165

163166

@@ -170,7 +173,8 @@ def generate_random(previous_atoms):
170173
while True:
171174
x, y = Atom.generate_random_position(co.C_RADIUS)
172175
if all(not atom.isColliding(x, y, co.C_RADIUS) for atom in previous_atoms):
173-
break
176+
if math.dist((x, y), (co.RESTART_BTN_POS_X, co.RESTART_BTN_POS_X)) > co.C_RADIUS + 20:
177+
break
174178
return Carbon(x, y)
175179

176180

@@ -183,5 +187,6 @@ def generate_random(previous_atoms):
183187
while True:
184188
x, y = Atom.generate_random_position(co.ELECTRON_RADIUS)
185189
if all(not atom.isColliding(x, y, co.ELECTRON_RADIUS) for atom in previous_atoms):
186-
break
190+
if math.dist((x, y), (co.RESTART_BTN_POS_X, co.RESTART_BTN_POS_X)) > co.ELECTRON_RADIUS + 20:
191+
break
187192
return Electron(x, y)

constants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class GameState(IntEnum):
2525
SPAWN_BORDER_MARGIN_LEFT = 100
2626
SPAWN_COLLIDES_MARGIN = 8
2727
T0_SPAWN = 1.5 * 60
28-
TINF_SPAWN = 3.5 * 60
28+
TINF_SPAWN = 4 * 60
2929
MAX_SPAWN_AT_ONCE = 3
3030
ONLY_HYDROGEN = 0
3131
ONLY_OXYGEN = ONLY_HYDROGEN + 2
@@ -180,7 +180,7 @@ def FORMULA_TEXT_COLOR(bonds_count):
180180
'You can get bonus points',
181181
'by discovering new molecules',
182182
'',
183-
'Pick up electrons to enter a spawning frenzy!']
183+
'Pick up electrons to make more atoms appear!']
184184
]
185185
TUTO_LAST_ATOM_FRAME = 2
186186
## Frame 0
@@ -244,7 +244,7 @@ def FORMULA_TEXT_COLOR(bonds_count):
244244
ELECTRON_TEXTURE = pyghelper.Image.create('resources/textures/electron.png')
245245
ELECTRON_PROBABILITY = 1 / (60 * 10)
246246
ELECTRON_MULTIPLIER = 0.2
247-
ELECTRON_DURATION = 2 * 60
247+
ELECTRON_DURATION = int(2.5 * 60)
248248

249249
# Indice
250250
HINT_DURATION = 20

resources/molecules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ H2O2 Hydrogen peroxide
55
H3N Ammonia
66
HNO Nitroxyl
77
N2 Dinitrogen
8-
NO2 Nitrogen dioxide
98
O3 Ozone
109
CH2O Formaldehyde
1110
CH4 Methane
@@ -20,6 +19,7 @@ CH2O2 Formic acid
2019
CH3N Methanimine
2120
CH4O Methanol
2221
CHNO Isocyanic acid
22+
H2O4 Tetraoxidane
2323
H4N2 Hydrazine
2424
HNO3 Nitric acid
2525
C2O2 Ethylene dione

0 commit comments

Comments
 (0)