Ajout d'une mechanique de dossier bloqués, et de nouvelles animations #52
|
@ -237,10 +237,17 @@ def __attacks(world: World):
|
|||
else:
|
||||
directory_entity[Animation] = Animation("search_directory")
|
||||
del entity[AttackPoint]
|
||||
del entity[Position]
|
||||
del entity[Order]
|
||||
del entity[Centered]
|
||||
del entity[Texture]
|
||||
|
||||
def del_anim_entity(_: World, entity: Entity):
|
||||
del entity[Animation]
|
||||
del entity[Position]
|
||||
del entity[Order]
|
||||
del entity[Centered]
|
||||
|
||||
entity[Animation] = Animation(
|
||||
"attack_point/despawn",
|
||||
callback=del_anim_entity,
|
||||
)
|
||||
|
||||
elif timer >= world[AttackSpeed] + 4.5 and world[State] == State.SEARCHING:
|
||||
world[State] = State.MOVING
|
||||
|
@ -248,7 +255,8 @@ def __attacks(world: World):
|
|||
# on suprime les dossiers bloqués
|
||||
for entity in world.query(BlockedDirectory):
|
||||
del entity[BlockedDirectory]
|
||||
entity[Texture] = Texture("directory.png")
|
||||
del entity[Texture]
|
||||
entity[Animation] = Animation("blocked_to_directory")
|
||||
|
||||
# On definit les directories comme bloques
|
||||
for _ in range(3):
|
||||
|
@ -265,7 +273,8 @@ def __attacks(world: World):
|
|||
== position.screen_position()
|
||||
):
|
||||
entity[BlockedDirectory] = BlockedDirectory()
|
||||
entity[Texture] = Texture("blocked_directory.png")
|
||||
del entity[Texture]
|
||||
entity[Animation] = Animation("directory_to_blocked")
|
||||
for _ in range(10):
|
||||
x = random.randint(0, COLUMNS - 1)
|
||||
y = random.randint(0, LINES - 1)
|
||||
|
@ -287,7 +296,7 @@ def __attacks(world: World):
|
|||
Position(position.screen_position()),
|
||||
Order(50),
|
||||
Centered(),
|
||||
Texture("attack_point.png"),
|
||||
Animation("attack_point/spawn"),
|
||||
)
|
||||
|
||||
world[AttackTimer] = AttackTimer(0.0)
|
||||
|
|
Loading…
Reference in a new issue