fix de la demande de pseudo
This commit is contained in:
parent
632ba7e1dd
commit
2c14af597c
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
from engine import CurrentScene, KeepAlive, Plugin
|
||||
from engine.ecs import Entity, World
|
||||
from engine.math import Vec2
|
||||
|
@ -36,7 +37,7 @@ def __spawn_elements(world: World):
|
|||
)
|
||||
)
|
||||
|
||||
if not os.path.exists("username.txt"):
|
||||
if not os.path.exists(Path.home() / ".ponguito/username.txt"):
|
||||
world.new_entity().set(
|
||||
TextBundle(
|
||||
"Quel est votre pseudo ?",
|
||||
|
@ -94,12 +95,12 @@ def __create_button(world: World, name: str):
|
|||
|
||||
def new_score(world: World, e: Entity):
|
||||
e.remove(Clickable)
|
||||
if os.path.exists("../username.txt"):
|
||||
with open("../username.txt", "r") as f:
|
||||
if os.path.exists(Path.home() / ".ponguito/username.txt"):
|
||||
with open(Path.home() / ".ponguito/username.txt", "r") as f:
|
||||
name = f.read()
|
||||
else:
|
||||
name = world.query(Writing).pop()
|
||||
with open("../username.txt", "w") as f:
|
||||
with open(Path.home() / ".ponguito/username.txt", "w") as f:
|
||||
f.write(name[Text])
|
||||
|
||||
try:
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.0.0
|
||||
1.0.1
|
Loading…
Reference in a new issue