diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-28 13:54:00 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-28 13:54:00 +0200 |
commit | f502b21183d307fcab9b353aa18609d15c3547f1 (patch) | |
tree | d071b60ce9893ebc3086cee73f64e17774ad2c7b /src/sliceitoff/game/hiscore.py | |
parent | da2bb3d8e7dcd7f7f0a0c2d2e214b422350d1993 (diff) |
hiscores: loading, saving, screen
Diffstat (limited to 'src/sliceitoff/game/hiscore.py')
-rw-r--r-- | src/sliceitoff/game/hiscore.py | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/sliceitoff/game/hiscore.py b/src/sliceitoff/game/hiscore.py deleted file mode 100644 index 734ad5e..0000000 --- a/src/sliceitoff/game/hiscore.py +++ /dev/null @@ -1,44 +0,0 @@ -import pygame - -from screens import hiscore_screen - -class HiScore(pygame.sprite.Group): - def __init__(self): - super().__init__() - self.add(hiscore_screen("")) - self.name = "" - - def update(self, **kwargs): - super().update(**kwargs) - - def step(self): - for event in pygame.event.get(): - if event.type == pygame.QUIT: - return False - if event.type == pygame.KEYDOWN: - if event.key in ( - pygame.K_ESCAPE, - pygame.K_KP_ENTER, - pygame.K_RETURN): - return False - if event.key in ( - pygame.K_RSHIFT, - pygame.K_LSHIFT, - pygame.K_RCTRL, - pygame.K_LCTRL, - pygame.K_RALT, - pygame.K_LALT, - pygame.K_RMETA, - pygame.K_LMETA, - pygame.K_LSUPER, - pygame.K_RSUPER, - pygame.K_SPACE): - continue - if event.key in (pygame.K_BACKSPACE, pygame.K_DELETE): - self.name = self.name [:-1] - elif pygame.key.name(event.key): - self.name += pygame.key.name(event.key)[0].upper() - self.name = self.name[:8] - self.empty() - self.add(hiscore_screen(self.name)) - return True |