From eee7dfd256988b08e72e467a806b5b9eba39fdc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sun, 7 Jan 2024 21:44:38 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20de=20la=20velocit=C3=A9e=20d'appar?= =?UTF-8?q?ition=20de=20la=20balle=20(#41)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.tipragot.fr/raphael/ponguito/pulls/41 --- src/scenes/game.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scenes/game.py b/src/scenes/game.py index f3b7aad..84f2e7a 100644 --- a/src/scenes/game.py +++ b/src/scenes/game.py @@ -368,7 +368,7 @@ def __spawn_ball(world: World): Fonction qui fait apparaitre une balle avec une velocitée aleatoire """ # random velocité - velocity = Vec2(2 * random.randint(100, 200), random.randint(100, 200)) + velocity = Vec2(2 * random.randint(100, 200), random.randint(-200, 200)) # mouvement a droite ou a gauche if random.randint(0, 1) == 0: @@ -481,6 +481,7 @@ def __bounce_on_left_wall(a: Entity, b: Entity): world[Player2Score] += 1 __update_scores(world, b) else: + world.query(Clickable).pop().destroy() world[CurrentScene] = game_over.GAME_OVER return False