Gameplay de la recherche dans les dossiers #44
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"end_image": "directory.png",
|
||||
"offset": {
|
||||
"x": 8,
|
||||
"y": -83
|
||||
|
|
|
@ -162,8 +162,12 @@ def __attacks(world: World):
|
|||
world[AttackTimer] = AttackTimer(world[AttackTimer] + world[Delta])
|
||||
timer = world[AttackTimer]
|
||||
if timer >= world[AttackSpeed] and world[State] == State.MOVING:
|
||||
entities = world.query(AttackPoint)
|
||||
if len(entities) > 0:
|
||||
world[State] = State.SEARCHING
|
||||
for entity in world.query(AttackPoint):
|
||||
else:
|
||||
world[State] = State.WAITING
|
||||
for entity in entities:
|
||||
position = entity[AttackPoint]
|
||||
for directory_entity in world.query(DirectoryPosition):
|
||||
if directory_entity[DirectoryPosition] == position:
|
||||
|
@ -173,9 +177,9 @@ def __attacks(world: World):
|
|||
del entity[Order]
|
||||
del entity[Centered]
|
||||
del entity[Texture]
|
||||
elif timer >= world[AttackSpeed] + 4 and world[State] == State.SEARCHING:
|
||||
elif timer >= world[AttackSpeed] + 4.5 and world[State] == State.SEARCHING:
|
||||
world[State] = State.WAITING
|
||||
elif timer >= world[AttackSpeed] + 5 and world[State] == State.WAITING:
|
||||
elif timer >= world[AttackSpeed] + 7 and world[State] == State.WAITING:
|
||||
world[State] = State.MOVING
|
||||
for _ in range(10):
|
||||
position = AttackPoint(
|
||||
|
@ -187,7 +191,7 @@ def __attacks(world: World):
|
|||
Position(position.screen_position(State.MOVING)),
|
||||
Order(50),
|
||||
Centered(),
|
||||
Texture("loupe.png"),
|
||||
Texture("attack_point.png"),
|
||||
)
|
||||
world[AttackTimer] = AttackTimer(0.0)
|
||||
world[AttackSpeed] = AttackSpeed(world[AttackSpeed] * 0.9)
|
||||
|
|
Loading…
Reference in a new issue