Aggiungi supporto per la risoluzione personalizzata e gestione della pausa nel gioco

This commit is contained in:
Matteo Benedetto
2024-12-23 00:59:48 +01:00
parent 42e2f4aa16
commit 97038023d5
10 changed files with 93 additions and 24 deletions
+8 -3
View File
@@ -53,7 +53,8 @@ class Timer(Bomb):
if self.age == AGE_THRESHOLD:
self.die()
def die(self, unit=None):
def die(self, unit=None, score=None):
score = 10
print("BOOM")
if not unit:
unit = self
@@ -68,11 +69,15 @@ class Timer(Bomb):
for victim in self.game.unit_positions.get((x, y), []):
if victim.id in self.game.units:
if victim.partial_move >= 0.5:
victim.die()
victim.die(score=score)
if score < 160:
score *= 2
for victim in self.game.unit_positions_before.get((x, y), []):
if victim.id in self.game.units:
if victim.partial_move < 0.5:
victim.die()
victim.die(score=score)
if score < 160:
score *= 2
else:
break
if direction == "N":