Suppression du délai inutile lors de l'envoi du score #20
|
@ -7,7 +7,6 @@ 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
|
||||
import requests as rq
|
||||
from scenes import game, thanks
|
||||
|
@ -22,12 +21,7 @@ def new_score(world: World, e: Entity):
|
|||
try:
|
||||
post = {"name": name[Text], "score": world[game.Player1Score]}
|
||||
rq.post(f"https://{IP}/new_score", post)
|
||||
world.new_entity().set(
|
||||
TimedEvent(
|
||||
1,
|
||||
lambda world, entity: world.set(CurrentScene(thanks.THANKS)),
|
||||
)
|
||||
)
|
||||
world.set(CurrentScene(thanks.THANKS))
|
||||
except Exception as error:
|
||||
print("Error with the serveur:", error)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ def __spawn_elements(world: World):
|
|||
position=Vec2(render.WIDTH / 2, render.HEIGHT / 2 - 75),
|
||||
origin=Vec2(0.5),
|
||||
),
|
||||
TimedEvent(3, lambda world, entity: world.set(CurrentScene(menu.MENU))),
|
||||
TimedEvent(1.5, lambda world, entity: world.set(CurrentScene(menu.MENU))),
|
||||
)
|
||||
world.new_entity().set(
|
||||
TextBundle(
|
||||
|
|
Loading…
Reference in a new issue