Possibilité d'appuiller sur Entré pour envoyer le score #19
|
@ -5,6 +5,7 @@ from engine.math import Vec2
|
|||
from plugins import render
|
||||
from plugins.click import Clickable
|
||||
from plugins.hover import HoveredTexture
|
||||
from plugins.inputs import Held, Pressed
|
||||
from plugins.render import SpriteBundle, Text, TextBundle
|
||||
from plugins.timing import TimedEvent
|
||||
from plugins.writing import Writing
|
||||
|
@ -83,10 +84,18 @@ def __spawn_elements(world: World):
|
|||
)
|
||||
|
||||
|
||||
def __enter_to_submit(world: World):
|
||||
"""
|
||||
Envoit le score losre que l'utilisateur appuie sur entrée.
|
||||
"""
|
||||
if "return" in world[Pressed] and len(world.query(Clickable)) > 0:
|
||||
new_score(world, world.query(Clickable).pop())
|
||||
|
||||
|
||||
SEND = (
|
||||
Plugin(
|
||||
[__spawn_elements],
|
||||
[],
|
||||
[__enter_to_submit],
|
||||
[],
|
||||
)
|
||||
+ writing.PLUGIN
|
||||
|
|
Loading…
Reference in a new issue