Correction de la velocity d'apparition de la balle du bonus multi (#46)
Co-authored-by: raphael <lauray@outlook.fr> Reviewed-on: #46
This commit is contained in:
parent
b4f25fefe8
commit
845c7cd6d8
|
@ -208,6 +208,13 @@ class Bonus(Enum):
|
||||||
case _:
|
case _:
|
||||||
return "reverse.png"
|
return "reverse.png"
|
||||||
|
|
||||||
|
class OriginBall(Entity):
|
||||||
|
"""
|
||||||
|
Composant qui represente la balle ratttaché a la balle simulée.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, entity: Entity):
|
||||||
|
super().__init__(entity.world, entity.identifier)
|
||||||
|
|
||||||
def __spawn_elements(world: World):
|
def __spawn_elements(world: World):
|
||||||
"""
|
"""
|
||||||
|
@ -414,6 +421,7 @@ def __check_bonus_collision(world: World):
|
||||||
Velocity(entity[Velocity]),
|
Velocity(entity[Velocity]),
|
||||||
Origin(entity[Origin]),
|
Origin(entity[Origin]),
|
||||||
CollisionHandler(__collision_handler),
|
CollisionHandler(__collision_handler),
|
||||||
|
OriginBall(entity),
|
||||||
)
|
)
|
||||||
physics.move_entity(simulated_ball, entity[Velocity] * world[Delta])
|
physics.move_entity(simulated_ball, entity[Velocity] * world[Delta])
|
||||||
simulated_ball.destroy()
|
simulated_ball.destroy()
|
||||||
|
@ -430,8 +438,8 @@ def __bonus_touched(ball: Entity, bonus: Entity):
|
||||||
match bonus[Bonus]:
|
match bonus[Bonus]:
|
||||||
case Bonus.MULTI:
|
case Bonus.MULTI:
|
||||||
# Fait apparaitre une balle qui part dans le sens inverse de la balle principale
|
# Fait apparaitre une balle qui part dans le sens inverse de la balle principale
|
||||||
velo = Vec2(ball[Velocity])
|
velo = Vec2(ball[OriginBall][Velocity])
|
||||||
velo.y *= -1
|
velo *= -1
|
||||||
bonus.world.new_entity().set(
|
bonus.world.new_entity().set(
|
||||||
SpriteBundle(
|
SpriteBundle(
|
||||||
"ball.png",
|
"ball.png",
|
||||||
|
|
Loading…
Reference in a new issue