diff options
author | Viljami Ilola <+@hix.fi> | 2024-04-08 02:55:25 +0300 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-04-08 02:55:25 +0300 |
commit | 74a735a7878bc76d01b644505f674cfe7bebd058 (patch) | |
tree | 6c7f64b88abffe9cdecb655ed950ac34485bbeaf | |
parent | eeac2c3bd87c542c48c806a98ea8c7c22db6dfc2 (diff) |
instructions screens
-rw-r--r-- | src/sliceitoff/assets/fonts.lst | 1 | ||||
-rw-r--r-- | src/sliceitoff/game/game.py | 18 | ||||
-rw-r--r-- | src/sliceitoff/screens/__init__.py | 3 | ||||
-rw-r--r-- | src/sliceitoff/screens/instructions1.py | 25 | ||||
-rw-r--r-- | src/sliceitoff/screens/instructions2.py | 26 | ||||
-rw-r--r-- | src/sliceitoff/screens/welcome.py | 22 |
6 files changed, 64 insertions, 31 deletions
diff --git a/src/sliceitoff/assets/fonts.lst b/src/sliceitoff/assets/fonts.lst index 268081b..19690fa 100644 --- a/src/sliceitoff/assets/fonts.lst +++ b/src/sliceitoff/assets/fonts.lst @@ -1,3 +1,2 @@ lcd assets gnufonts UTIL GNUFONTS LCD.FNT 8x8 assets gnufonts UTIL GNUFONTS 8X8.FNT -computer assets gnufonts UTIL GNUFONTS COMPUTER.FNT diff --git a/src/sliceitoff/game/game.py b/src/sliceitoff/game/game.py index fea5151..9afe342 100644 --- a/src/sliceitoff/game/game.py +++ b/src/sliceitoff/game/game.py @@ -9,7 +9,10 @@ import pygame from display import Display from text import Fonts from stats import Stats -from screens import welcome_screen, hiscores_screen +from screens import ( + hiscores_screen, + instructions1_screen, + instructions2_screen) from hiscores import HiScores from mainmenu import Mainmenu, MenuItems @@ -31,12 +34,13 @@ class Game: def __del__(self): pygame.quit() - def welcome(self): + def instructions(self): """ displays instruction and waits a key """ - ws = Show(welcome_screen()) - while ws.active: - ws.update(dt = self.clock.tick()) - self.display.update( [ws] ) + for page in [instructions1_screen, instructions2_screen]: + screen = Show(page()) + while screen.active: + screen.update(dt = self.clock.tick()) + self.display.update( [screen] ) def show_highscores(self): """ displays highscores and waits a key """ @@ -81,7 +85,7 @@ class Game: case MenuItems.HISCORES: self.show_highscores() case MenuItems.INSTRUCT: - self.welcome() + self.instructions() case MenuItems.NEWGAME: self.newgame() if self.hiscores.high_enough(self.stats.score): diff --git a/src/sliceitoff/screens/__init__.py b/src/sliceitoff/screens/__init__.py index d9d66c5..6b5165e 100644 --- a/src/sliceitoff/screens/__init__.py +++ b/src/sliceitoff/screens/__init__.py @@ -1,9 +1,10 @@ """ screens - collection of functions that generates group of spites to fill the screen """ -from .welcome import welcome_screen from .levelup import levelup_screen from .gameover import gameover_screen from .level import level_screen from .initials import initials_screen from .hiscores import hiscores_screen from .mainmenu import mainmenu_screen +from .instructions1 import instructions1_screen +from .instructions2 import instructions2_screen diff --git a/src/sliceitoff/screens/instructions1.py b/src/sliceitoff/screens/instructions1.py new file mode 100644 index 0000000..58d6f58 --- /dev/null +++ b/src/sliceitoff/screens/instructions1.py @@ -0,0 +1,25 @@ +""" screens.instructions1 - First page of instructions""" +from text import TextPage + +def instructions1_screen(): + """ Instructions about the goal """ + return TextPage( + "\n Slice It Off!\n\n" + "\n" + " What to do?\n" + "\n" + " * Move the slicing tool\n" + " in the playarea.\n" + "\n" + " * Slice when there is\n" + " no-one on the way.\n" + "\n" + " * Empty slices fall off.\n" + "\n" + " * If playarea is sliced\n" + " below 20% you level up.\n" + "\n" + " * Slicing costs points.\n", + font = '8x8', + size = (12_000, 12_000), + pos = (0, 0) ) diff --git a/src/sliceitoff/screens/instructions2.py b/src/sliceitoff/screens/instructions2.py new file mode 100644 index 0000000..19b8928 --- /dev/null +++ b/src/sliceitoff/screens/instructions2.py @@ -0,0 +1,26 @@ +""" screens.instructions2 - Page about scoring """ +from text import TextPage + +def instructions2_screen(): + """ Instructions about scoring """ + return TextPage( + "\n Slice It Off!\n\n" + "\n" + " Getting scores?\n" + "\n" + " \xee\x12\xef Level up gives bonus\n" + " and also multiplies.\n" + "\n" + " \xec\x03\xef Extra lives gives bonus\n" + "\n" + " \xed\x0e\xef Getting level done\n" + " before bonus timer.\n" + "\n" + " \xe9\xfe\xef Area smaller than 20%\n" + " gives bonuses.\n" + "\n" + " \xea\x0f\xef Keeping herd together\n" + " in same area.\n", + font = '8x8', + size = (12_000, 12_000), + pos = (0, 0) ) diff --git a/src/sliceitoff/screens/welcome.py b/src/sliceitoff/screens/welcome.py deleted file mode 100644 index 7078f1f..0000000 --- a/src/sliceitoff/screens/welcome.py +++ /dev/null @@ -1,22 +0,0 @@ -""" screens.welcome - name, objective and scoring """ -from text import TextPage - -def welcome_screen(): - """ welcome_screen - could be also considered as instruction screen """ - return TextPage( - " Slice it off!\n" - " \n" - " Your mission:\n" - " * Slice area to 20%\n" - " * Slice no-one\n" - "\n" - " Gain score by:\n" - " * Keeping herd together\n" - " * Not slicing unnecessarily\n" - " * Making area even smaller\n" - " * Not losing lives\n" - " * Being fast\n" - " * Leveling up\n", - font = 'computer', - size = (8_000, 16_000), - grid = (9_000, 16_000) ) |