Suppression du délai inutile lors de l'envoi du score (#20)

Reviewed-on: #20
Reviewed-by: Corentin <solois.corentin@gmail.com>
Co-authored-by: Tipragot <contact@tipragot.fr>
Co-committed-by: Tipragot <contact@tipragot.fr>
This commit is contained in:
Tipragot 2024-01-07 10:01:51 +00:00 committed by Corentin
parent 3366f71e51
commit d668dc9c4b
2 changed files with 2 additions and 8 deletions

View file

@ -7,7 +7,6 @@ from plugins.click import Clickable
from plugins.hover import HoveredTexture from plugins.hover import HoveredTexture
from plugins.inputs import Held, Pressed from plugins.inputs import Held, Pressed
from plugins.render import SpriteBundle, Text, TextBundle from plugins.render import SpriteBundle, Text, TextBundle
from plugins.timing import TimedEvent
from plugins.writing import Writing from plugins.writing import Writing
import requests as rq import requests as rq
from scenes import game, thanks from scenes import game, thanks
@ -22,12 +21,7 @@ def new_score(world: World, e: Entity):
try: try:
post = {"name": name[Text], "score": world[game.Player1Score]} post = {"name": name[Text], "score": world[game.Player1Score]}
rq.post(f"https://{IP}/new_score", post) rq.post(f"https://{IP}/new_score", post)
world.new_entity().set( world.set(CurrentScene(thanks.THANKS))
TimedEvent(
1,
lambda world, entity: world.set(CurrentScene(thanks.THANKS)),
)
)
except Exception as error: except Exception as error:
print("Error with the serveur:", error) print("Error with the serveur:", error)

View file

@ -17,7 +17,7 @@ def __spawn_elements(world: World):
position=Vec2(render.WIDTH / 2, render.HEIGHT / 2 - 75), position=Vec2(render.WIDTH / 2, render.HEIGHT / 2 - 75),
origin=Vec2(0.5), 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( world.new_entity().set(
TextBundle( TextBundle(