Ajout du titre ScoreBoard (#42)

Reviewed-on: #42
This commit is contained in:
Raphaël 2024-01-07 22:15:14 +00:00
parent eee7dfd256
commit 111df0d808

View file

@ -91,6 +91,19 @@ def __spawn_elements(world: World):
Clickable(__go_to_settings), Clickable(__go_to_settings),
) )
world.new_entity().set(
TextBundle(
"ScoreBoard",
0,
75,
position=Vec2(
render.WIDTH / 2,
325,
),
origin=Vec2(0.5),
)
)
def __go_to_settings(world: World, _e: Entity): def __go_to_settings(world: World, _e: Entity):
world[CurrentScene] = settings.SETTINGS world[CurrentScene] = settings.SETTINGS
@ -104,7 +117,7 @@ def __spawn_score(world: World):
world.new_entity().set( world.new_entity().set(
TextBundle( TextBundle(
f"{name}", f"{name}",
position=Vec2(render.WIDTH / 2 - 350, 325 + 50 * i), position=Vec2(render.WIDTH / 2 - 300, 400 + 50 * i),
origin=Vec2(0), origin=Vec2(0),
order=1, order=1,
) )
@ -113,7 +126,7 @@ def __spawn_score(world: World):
world.new_entity().set( world.new_entity().set(
TextBundle( TextBundle(
f"{score}", f"{score}",
position=Vec2(render.WIDTH / 2 + 350, 325 + 50 * i), position=Vec2(render.WIDTH / 2 + 300, 400 + 50 * i),
origin=Vec2(1, 0), origin=Vec2(1, 0),
order=1, order=1,
) )