bouton style vert

This commit is contained in:
CoCo_Sol 2023-10-30 01:34:04 +01:00
parent e6cf30257e
commit 6cc06de6d1
10 changed files with 15 additions and 12 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -1,5 +1,5 @@
"""
Définis la scène du jeu classique, sans variante.
Définis la scène du jeu menteur, sans variante.
"""
from random import randint
@ -52,6 +52,9 @@ class IsRunning:
"""
COLOR_TEXT = Color(59, 162, 0)
def __initialize_world(world: World):
"""
Initialise le monde du menu.
@ -66,11 +69,11 @@ def __initialize_world(world: World):
# Bouton valider/rejouer
world.create_entity(
Position(Display.WIDTH / 2, 900),
Position(Display.WIDTH / 2, 880),
Order(1),
Centered(),
Texture("classique/valider.png"),
HoveredTexture("classique/valider_hover.png"),
Texture("menteur/valider.png"),
HoveredTexture("menteur/valider_hover.png"),
Clickable(lambda world, _: _update(world)),
)
@ -81,7 +84,7 @@ def __initialize_world(world: World):
Centered(),
typing.Typing("1234567890"),
Text(""),
Color(61, 22, 58),
COLOR_TEXT,
TextSize(150),
)
@ -92,17 +95,17 @@ def __initialize_world(world: World):
Centered(),
TextDialogue(),
TextSize(150),
Color(61, 22, 58),
COLOR_TEXT,
Text("Devine le nombre..."),
)
# Text qui affiche le nombre d'essai
world.create_entity(
Position(Display.WIDTH - 700, 100),
Position(Display.WIDTH - 750, 120),
Order(4),
TextSize(100),
NombreEssaiText(),
Color(61, 22, 58),
COLOR_TEXT,
Text("il reste : 15 essais"),
)
@ -110,9 +113,9 @@ def __initialize_world(world: World):
world.create_entity(
Order(11),
Position(100, 100),
Texture("classique/arrow.png"),
Texture("menteur/arrow.png"),
Clickable(lambda world, _: world[Game].change_scene("menu")),
HoveredTexture("classique/arrow_hover.png"),
HoveredTexture("menteur/arrow_hover.png"),
)
# Les ressources.
@ -192,8 +195,8 @@ def end_game(world: World, state: str):
# on change la texture du button submit.
for entity in world.query(Clickable, Centered):
entity[Texture] = Texture("classique/play_again.png")
entity[HoveredTexture] = HoveredTexture("classique/play_again_hover.png")
entity[Texture] = Texture("menteur/play_again.png")
entity[HoveredTexture] = HoveredTexture("menteur/play_again_hover.png")
def _check_return(world: World):