From 073351fc0b6bf82fe6bd1d9427d236cdaae4627c Mon Sep 17 00:00:00 2001 From: CoCoSol007 Date: Sun, 7 Jan 2024 14:19:50 +0100 Subject: [PATCH] chnage spawn ball --- 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