WIP: Blocked Directory

This commit is contained in:
CoCo_Sol 2023-10-30 18:11:22 +01:00
parent c41cf69b0a
commit 4fb3aeaf04

View file

@ -107,6 +107,12 @@ class UserDirectory:
""" """
class BlockedDirectory:
"""
Un component qui permet de savoir que le dossier est bloqué.
"""
class GameStarted: class GameStarted:
""" """
Une ressource qui permet de savoir que le jeu commence. Une ressource qui permet de savoir que le jeu commence.
@ -249,6 +255,16 @@ def __attacks(world: World):
Centered(), Centered(),
Texture("attack_point.png"), Texture("attack_point.png"),
) )
# On definit les directories comme bloques
for _ in range(3):
position = Vec2(
random.randint(0, COLUMNS - 1),
random.randint(0, LINES - 1),
)
for entity in world.query(DirectoryPosition):
if entity[DirectoryPosition] == position and UserDirectory not in entity:
entity[BlockedDirectory] = BlockedDirectory()
world[AttackTimer] = AttackTimer(0.0) world[AttackTimer] = AttackTimer(0.0)
world[AttackSpeed] = AttackSpeed(world[AttackSpeed] * 0.9) world[AttackSpeed] = AttackSpeed(world[AttackSpeed] * 0.9)