diff options
author | Viljami Ilola <+@hix.fi> | 2024-04-08 23:50:29 +0300 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-04-08 23:50:29 +0300 |
commit | b1e18bc5b92826078fc7c480a2662b9208f2edac (patch) | |
tree | df9d91a26357e8af7c94e15b899914057bf94808 | |
parent | a433d57a893d3605db5fe1eb501e5ae25d547ac1 (diff) |
nt compatibility
-rw-r--r-- | README.txt | 6 | ||||
-rw-r--r-- | pyproject.toml | 2 | ||||
-rw-r--r-- | src/sliceitoff/hiscores/hiscores.py | 17 | ||||
-rw-r--r-- | src/sliceitoff/player/life.py | 2 |
4 files changed, 19 insertions, 8 deletions
@@ -18,6 +18,12 @@ Installing: Distribution package can be installed normally: - `pipx install sliceitoff.*.tar.gz` +License: + + This project uses GPL-2 license. Used components uses their + licenses. There is gnufonts package from Freedos included in the + source tree and it's license can be fount on it's directory. + Developement: Project makes heavy use of poetry build and dependencies control diff --git a/pyproject.toml b/pyproject.toml index fb01158..bd20970 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "sliceitoff" -version = "0.3-alpha" +version = "0.3-beta" description = "Arcade game where one slices play area off avoiding enemies." authors = ["Viljami Ilola <+@hix.fi>"] readme = "README.txt" 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 = ( |