From 61d96be63258d1b5d54d889d59aba85332b99f72 Mon Sep 17 00:00:00 2001 From: CoCo_Sol Date: Sat, 4 Nov 2023 21:20:22 +0100 Subject: [PATCH] fix erreur de supression des projectile type plui --- src/scenes/story/boss_fight.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/scenes/story/boss_fight.py b/src/scenes/story/boss_fight.py index 8fea733..8d64b5e 100644 --- a/src/scenes/story/boss_fight.py +++ b/src/scenes/story/boss_fight.py @@ -4,8 +4,6 @@ Scene de Combat final contre edmond, inspiré du combat d'omega flowey dans unde from enum import Enum import random -from tkinter import RIGHT -from turtle import down, left, right, shapesize from engine import CurrentScene, Scene from engine.ecs import World @@ -427,23 +425,32 @@ def __create_spike(world: World, time: float): ) +class RainProjectiles(Vec2): + """ + TODO + """ + + def __rainning_projectiles(world: World): while IsRunning: + random_pos = random.randint(0, 1399) entity = world.new_entity() entity.set( Sprite( world[Assets].get_texture("error"), - Vec2(random.randint(0, 1399), 300), + Vec2(random_pos, 300), 4, ), Animation("projectiles", 60, True), smooth.Speed(1.3), Hurt(10), + smooth.Target(Vec2(random_pos, 1121)), + RainProjectiles(), ) - entity.set(smooth.Target(Vec2(entity[Sprite].position.x, 1121))) yield wait(0.5) - if entity[Sprite].position.y >= 1080: - entity.destroy() + for entity in world.query(RainProjectiles, Sprite): + if entity[Sprite].position.y > 1120: + entity.destroy() def __check_key_pressed(world: World):