From 2c14af597ccce570f9cc4ca6dd72c228d5cbf63b Mon Sep 17 00:00:00 2001 From: raphael Date: Tue, 16 Jan 2024 10:32:40 +0100 Subject: [PATCH] fix de la demande de pseudo --- src/scenes/game_over.py | 9 +++++---- version.txt | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/scenes/game_over.py b/src/scenes/game_over.py index 2228ea7..20c50ed 100644 --- a/src/scenes/game_over.py +++ b/src/scenes/game_over.py @@ -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: diff --git a/version.txt b/version.txt index afaf360..7f20734 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 \ No newline at end of file