Animation d'arrivé des prjectiles

This commit is contained in:
Raphaël 2023-11-04 22:26:24 +01:00
parent 61d96be632
commit 01a233e3e2
14 changed files with 12 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -3,6 +3,7 @@ Scene de Combat final contre edmond, inspiré du combat d'omega flowey dans unde
""" """
from enum import Enum from enum import Enum
from os import kill
import random import random
from engine import CurrentScene, Scene from engine import CurrentScene, Scene
@ -433,23 +434,27 @@ class RainProjectiles(Vec2):
def __rainning_projectiles(world: World): def __rainning_projectiles(world: World):
while IsRunning: while IsRunning:
random_pos = random.randint(0, 1399) animation = Animation(
"projectiles_coming",
30,
)
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_pos, 300), Vec2(random.randint(0, 1399), 300),
4, 4,
), ),
Animation("projectiles", 60, True), animation,
smooth.Speed(1.3), smooth.Speed(2),
Hurt(10), Hurt(10),
smooth.Target(Vec2(random_pos, 1121)),
RainProjectiles(),
) )
yield animation.wait()
# yield wait(0.5)
entity.set(smooth.Target(Vec2(entity[Sprite].position.x, 1121)))
yield wait(0.5) yield wait(0.5)
for entity in world.query(RainProjectiles, Sprite): for entity in world.query(RainProjectiles, Sprite):
if entity[Sprite].position.y > 1120: if entity[Sprite].position.y > 1080:
entity.destroy() entity.destroy()