summaryrefslogtreecommitdiff
path: root/src/sliceitoff
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliceitoff')
-rw-r--r--src/sliceitoff/hiscores/hiscores.py17
-rw-r--r--src/sliceitoff/player/life.py2
2 files changed, 12 insertions, 7 deletions
diff --git a/src/sliceitoff/hiscores/hiscores.py b/src/sliceitoff/hiscores/hiscores.py
index a6c2bf0..5ce8ced 100644
--- a/src/sliceitoff/hiscores/hiscores.py
+++ b/src/sliceitoff/hiscores/hiscores.py
@@ -1,5 +1,6 @@
-""" hiscores.hiscores - high socres: loading, saving, converting to string"""
+""" hiscores.hiscores - high socres: loading, saving, converting to string """
import os
+from pathlib import Path
from .static import INITIAL_HIGHSCORES, MAX_HIGHSCORES
@@ -8,10 +9,13 @@ class HiScores:
def __init__(self):
""" On creation load high scores from config file """
self.table=[]
- self.config_filename = os.path.join(
- os.getenv('HOME'),
- ".config",
- "sliceitoffrc")
+ if os.name == 'nt':
+ self.config_filename = os.path.join(Path.home(), "sliceitoff.cfg")
+ else:
+ self.config_filename = os.path.join(
+ Path.home(),
+ ".config",
+ "sliceitoffrc")
if not os.path.isfile(self.config_filename):
self.table=INITIAL_HIGHSCORES[:]
return
@@ -48,13 +52,14 @@ class HiScores:
config_file.writelines(oldlines)
for score, name in self.table:
config_file.write(f"hiscore={score}!{name}\n")
+ config_file.write("\n")
def __str__(self):
text = (
" "
"\xeeH\xecI\xedG\xe9H "
"\xeaS\xedC\xeeO\xebR\xe9E\xecS\xeb!\xed!\n\n")
- half = len(self.table)//2
+ half = len(self.table) // 2
for i in range(half):
text += (
f"\xed{self.table[i][1]:<3s} "
diff --git a/src/sliceitoff/player/life.py b/src/sliceitoff/player/life.py
index e187201..ef39869 100644
--- a/src/sliceitoff/player/life.py
+++ b/src/sliceitoff/player/life.py
@@ -28,7 +28,7 @@ class Life(pygame.sprite.Group):
def lose_life(self):
""" Commands group to regenerate its sprites and sets timeout """
- self.timeout = 2_000
+ self.timeout = 1_500
font_width = int(Scaling.factor * 200_000)
block_width = int(Scaling.factor * 8_000)
offset = (