Fix du bonus qui ne se met pas sur la bonne personne

This commit is contained in:
raphael 2024-01-08 21:33:26 +01:00
parent f0925b6312
commit 0c7375bc9c

View file

@ -472,12 +472,14 @@ def __collision_with_ball(a: Entity, b: Entity):
""" """
if Ball in a: if Ball in a:
a.world.new_entity().set(Sound("bound.mp3")) a.world.new_entity().set(Sound("bound.mp3"))
if Player1 in b or Player2 in b and Ball in a: if Player1 in b or Player2 in b:
# Met a jour le dernier joueur a avoir touché la balle if Ball in a:
for player in a.world.query(LastPlayerTurn): # Met a jour le dernier joueur a avoir touché la balle
del player[LastPlayerTurn] for player in a.world.query(LastPlayerTurn):
b.set(LastPlayerTurn()) del player[LastPlayerTurn]
return __bounce_on_player(a, b) b.set(LastPlayerTurn())
print(b)
return __bounce_on_player(a, b)
return True return True