Changement du spawn de la balle (#34)

Reviewed-on: #34
Reviewed-by: Tipragot <contact@tipragot.fr>
Co-authored-by: CoCoSol007 <solois.corentin@gmail.com>
Co-committed-by: CoCoSol007 <solois.corentin@gmail.com>
This commit is contained in:
CoCo_Sol 2024-01-07 13:22:04 +00:00 committed by Tipragot
parent c45491f048
commit 647e053cae

View file

@ -383,7 +383,20 @@ def __bonus_touched(ball: Entity, bonus: Entity):
player = ball.world.query(LastPlayerTurn).pop() player = ball.world.query(LastPlayerTurn).pop()
match bonus[Bonus]: match bonus[Bonus]:
case Bonus.MULTI: 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) ball.world[TimeUntilBonus].start(ball.world)
case Bonus.BIG: case Bonus.BIG:
player[Scale] *= 2 player[Scale] *= 2