adding comments

This commit is contained in:
Vishal 2024-05-20 04:08:49 +05:30 committed by GitHub
parent 1f3d9ef0f8
commit 18f89a0904
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -243,24 +243,20 @@ class AssaultGame(bs.TeamGameActivity[Player, Team]):
)
bs.timer(0.5, light.delete)
bs.animate(light, 'intensity', {0: 0, 0.1: 1.0, 0.5: 0})
def teleport(
client: Player,
pos: Sequence[float],
num: float
) -> None:
if client.actor:
client.actor.handlemessage(
bs.StandMessage(pos,num)
)
if player.actor:
random_num = random.uniform(0, 360)
# A simple hack to work around the chaos caused by
# any sticky bomb's sticky material, if present and
# is sticking to the players.
player.actor.handlemessage(
bs.StandMessage(new_pos, random_num)
)
bs.timer(
0.01,
bs.Call(teleport, player, new_pos, random_num)
)
bs.timer(0.01, bs.Call(
self.teleport,
player,
new_pos,
random_num
))
# Have teammates celebrate.
for player in player_team.players:
@ -272,6 +268,15 @@ class AssaultGame(bs.TeamGameActivity[Player, Team]):
if player_team.score >= self._score_to_win:
self.end_game()
def teleport(
self,
client: Player,
pos: Sequence[float],
num: float
) -> None:
if client.actor:
client.actor.handlemessage(bs.StandMessage(pos,num))
@override
def end_game(self) -> None:
results = bs.GameResults()