fix erreur de supression des projectile type plui

This commit is contained in:
CoCo_Sol 2023-11-04 21:20:22 +01:00
parent bd7176e791
commit 61d96be632

View file

@ -4,8 +4,6 @@ Scene de Combat final contre edmond, inspiré du combat d'omega flowey dans unde
from enum import Enum from enum import Enum
import random import random
from tkinter import RIGHT
from turtle import down, left, right, shapesize
from engine import CurrentScene, Scene from engine import CurrentScene, Scene
from engine.ecs import World 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): def __rainning_projectiles(world: World):
while IsRunning: while IsRunning:
random_pos = random.randint(0, 1399)
entity = world.new_entity() entity = world.new_entity()
entity.set( entity.set(
Sprite( Sprite(
world[Assets].get_texture("error"), world[Assets].get_texture("error"),
Vec2(random.randint(0, 1399), 300), Vec2(random_pos, 300),
4, 4,
), ),
Animation("projectiles", 60, True), Animation("projectiles", 60, True),
smooth.Speed(1.3), smooth.Speed(1.3),
Hurt(10), Hurt(10),
smooth.Target(Vec2(random_pos, 1121)),
RainProjectiles(),
) )
entity.set(smooth.Target(Vec2(entity[Sprite].position.x, 1121)))
yield wait(0.5) yield wait(0.5)
if entity[Sprite].position.y >= 1080: for entity in world.query(RainProjectiles, Sprite):
entity.destroy() if entity[Sprite].position.y > 1120:
entity.destroy()
def __check_key_pressed(world: World): def __check_key_pressed(world: World):