From 1c37180ff859f9c851fac16e25b0e61a89ff518c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl?= Date: Sun, 7 Jan 2024 22:36:59 +0100 Subject: [PATCH] Correction de l'apparition du bouton du menu --- src/scenes/game.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/scenes/game.py b/src/scenes/game.py index 177d8b0..f3b7aad 100644 --- a/src/scenes/game.py +++ b/src/scenes/game.py @@ -326,22 +326,6 @@ def __spawn_ellements(world: World): Score(), ) - -def __spawn_bonus(world: World): - bonus = Bonus.aleatoire(world) - world.new_entity().set( - SpriteBundle( - Bonus.get_texture(bonus), - 3, - Vec2( - random.randint(400, render.WIDTH - 400), - random.randint(100, render.HEIGHT - 100), - ), - Vec2(70), - Vec2(0.5), - ), - bonus, - ) world.new_entity().set( SpriteBundle( f"button_menu_icon.png", @@ -362,6 +346,23 @@ def __go_to_menu(world: World, _e: Entity): world[CurrentScene] = menu.MENU +def __spawn_bonus(world: World): + bonus = Bonus.aleatoire(world) + world.new_entity().set( + SpriteBundle( + Bonus.get_texture(bonus), + 3, + Vec2( + random.randint(400, render.WIDTH - 400), + random.randint(100, render.HEIGHT - 100), + ), + Vec2(70), + Vec2(0.5), + ), + bonus, + ) + + def __spawn_ball(world: World): """ Fonction qui fait apparaitre une balle avec une velocitée aleatoire