Gameplay de la recherche dans les dossiers #44
|
@ -21,6 +21,8 @@ from plugins import smooth
|
||||||
|
|
||||||
__LINES = 3
|
__LINES = 3
|
||||||
__COLUMNS = 5
|
__COLUMNS = 5
|
||||||
|
__WAITING_SPACING = 150
|
||||||
|
__SEARCHING_SPACING = 200
|
||||||
|
|
||||||
|
|
||||||
class State(Enum):
|
class State(Enum):
|
||||||
|
@ -156,12 +158,15 @@ def __update_positions(world: World):
|
||||||
"""
|
"""
|
||||||
for entity in world.query(DirectoryPosition):
|
for entity in world.query(DirectoryPosition):
|
||||||
position = entity[DirectoryPosition]
|
position = entity[DirectoryPosition]
|
||||||
offset = Vec2(-300, -50) if world[State] == State.WAITING else Vec2(-300, -75)
|
size = Vec2(
|
||||||
size = Vec2(150, 100) if world[State] == State.WAITING else Vec2(150, 150)
|
__WAITING_SPACING if world[State] == State.WAITING else __SEARCHING_SPACING
|
||||||
|
)
|
||||||
|
offset = -(size * Vec2(__COLUMNS - 1, __LINES - 1) / 2)
|
||||||
first_position = Vec2(Display.WIDTH / 2, Display.HEIGHT / 2) + offset
|
first_position = Vec2(Display.WIDTH / 2, Display.HEIGHT / 2) + offset
|
||||||
entity[smooth.Target] = smooth.Target(
|
entity[smooth.Target] = smooth.Target(
|
||||||
first_position + Vec2(position.x, position.y) * size
|
first_position + Vec2(position.x, position.y) * size
|
||||||
)
|
)
|
||||||
|
entity[Order] = Order(position.y + 1)
|
||||||
|
|
||||||
|
|
||||||
SCENE = (
|
SCENE = (
|
||||||
|
|
Loading…
Reference in a new issue