From 647e053caeb213eda349be469e8d5c3ef05a45ca Mon Sep 17 00:00:00 2001 From: CoCoSol007 Date: Sun, 7 Jan 2024 13:22:04 +0000 Subject: [PATCH] Changement du spawn de la balle (#34) Reviewed-on: https://git.tipragot.fr/raphael/ponguito/pulls/34 Reviewed-by: Tipragot Co-authored-by: CoCoSol007 Co-committed-by: CoCoSol007 --- src/scenes/game.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/scenes/game.py b/src/scenes/game.py index 5b97ae0..7c2ae00 100644 --- a/src/scenes/game.py +++ b/src/scenes/game.py @@ -383,7 +383,20 @@ def __bonus_touched(ball: Entity, bonus: Entity): player = ball.world.query(LastPlayerTurn).pop() match bonus[Bonus]: case Bonus.MULTI: - __spawn_ball(bonus.world) + velo = Vec2(ball[Velocity]) + velo.y *= -1 + bonus.world.new_entity().set( + SpriteBundle( + "ball.png", + 0, + ball[Position], + Vec2(40, 40), + Vec2(0.5), + ), + Ball(), + Velocity(velo), + CollisionHandler(__collision_with_ball), + ) ball.world[TimeUntilBonus].start(ball.world) case Bonus.BIG: player[Scale] *= 2