Ajout basic_game dans menu

This commit is contained in:
Raphaël 2023-11-02 19:46:06 +01:00
parent 363ea0646d
commit 4dfb8e4fe9
2 changed files with 8 additions and 8 deletions

View file

@ -7,7 +7,7 @@ from plugins.inputs import Pressed
from plugins.text import Text
class Typing:
class Writing:
"""
Marque une entité comme un texte qui s'ecrit en fonction du clavier
"""
@ -22,7 +22,7 @@ def __update(world: World):
Met a jour les entitées contenant le composant Typing
"""
pressed = world[Pressed]
for entity in world.query(Typing, Text):
for entity in world.query(Writing, Text):
text = entity[Text]
for key in pressed:
if key == "backspace":
@ -30,8 +30,8 @@ def __update(world: World):
if key.startswith("["): # pavé numerique
key = key[1]
if (
key in entity[Typing].accepted_chars
and len(text.text) < entity[Typing].max_chars
key in entity[Writing].accepted_chars
and len(text.text) < entity[Writing].max_chars
):
text.text += key

View file

@ -3,7 +3,7 @@ La scène du menu principal du jeu.
Dans cette scène nous pouvons choisir le mode de jeu.
"""
from scenes import basic_game
from engine import CurrentScene, Scene
from engine.ecs import Entity, World
from engine.math import Vec2
@ -40,11 +40,11 @@ def __on_click_butons(world: World, entity: Entity, name: str):
world.new_entity().set(Sound(world[Assets].get_sound("click")))
match name:
case "classique":
pass # TODO
world[CurrentScene] = basic_game.CLASSIC
case "menteur":
pass # TODO
world[CurrentScene] = basic_game.LIAR
case "tricheur":
pass # TODO
world[CurrentScene] = basic_game.CHEATER
case "histoire":
pass # TODO
case _: