mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
meteor showered :)
This commit is contained in:
parent
f11d4ac261
commit
cae2ee7642
@ -69,6 +69,7 @@ class MeteorShowerGame(bs.TeamGameActivity[Player, Team]):
|
|||||||
self._last_player_death_time: float | None = None
|
self._last_player_death_time: float | None = None
|
||||||
self._meteor_time = 2.0
|
self._meteor_time = 2.0
|
||||||
self._timer: OnScreenTimer | None = None
|
self._timer: OnScreenTimer | None = None
|
||||||
|
self._ended: bool = False
|
||||||
|
|
||||||
# Some base class overrides:
|
# Some base class overrides:
|
||||||
self.default_music = (
|
self.default_music = (
|
||||||
@ -153,6 +154,9 @@ class MeteorShowerGame(bs.TeamGameActivity[Player, Team]):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def _check_end_game(self) -> None:
|
def _check_end_game(self) -> None:
|
||||||
|
# We don't want to end this activity more than once.
|
||||||
|
if self._ended: return
|
||||||
|
|
||||||
living_team_count = 0
|
living_team_count = 0
|
||||||
for team in self.teams:
|
for team in self.teams:
|
||||||
for player in team.players:
|
for player in team.players:
|
||||||
@ -261,4 +265,5 @@ class MeteorShowerGame(bs.TeamGameActivity[Player, Team]):
|
|||||||
# Submit the score value in milliseconds.
|
# Submit the score value in milliseconds.
|
||||||
results.set_team_score(team, int(1000.0 * longest_life))
|
results.set_team_score(team, int(1000.0 * longest_life))
|
||||||
|
|
||||||
|
self._ended = True
|
||||||
self.end(results=results)
|
self.end(results=results)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user