Fix du bonus qui ne se met pas sur la bonne personne (#47)

Co-authored-by: raphael <lauray@outlook.fr>
Reviewed-on: #47
This commit is contained in:
Raphaël 2024-01-08 20:34:28 +00:00
parent f0925b6312
commit b4f25fefe8

View file

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