Correction de la velocity d'apparition de la balle du bonus multi #46

Merged
raphael merged 2 commits from multi into main 2024-01-08 20:36:45 +00:00
Showing only changes of commit 295a032ce5 - Show all commits

View file

@ -480,12 +480,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