ecs #58
|
@ -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
|
||||
|
|
@ -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 _:
|
||||
|
|
Loading…
Reference in a new issue