diff options
71 files changed, 125 insertions, 17 deletions
diff --git a/src/sliceitoff/__main__.py b/src/sliceitoff/__main__.py index 6845d94..17e7317 100644 --- a/src/sliceitoff/__main__.py +++ b/src/sliceitoff/__main__.py @@ -8,7 +8,7 @@ from pathlib import Path import pygame from display import Display -from images import Images +from images import Images, Fonts from game import Level @@ -17,7 +17,9 @@ def sliceitoff(): pygame.init() display = Display() - Images.load_images( Path(__file__).parent.resolve() ) + current_path = Path(__file__).parent.resolve() + Images.load_images( current_path ) + Fonts.load_fonts( current_path ) level1 = Level(display = display, level = 10, score = 10) diff --git a/src/sliceitoff/assets/fonts.lst b/src/sliceitoff/assets/fonts.lst new file mode 100644 index 0000000..0e85a1c --- /dev/null +++ b/src/sliceitoff/assets/fonts.lst @@ -0,0 +1 @@ +lcd assets gnufonts UTIL GNUFONTS LCD.FNT diff --git a/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.DE b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.DE new file mode 100644 index 0000000..5082bd5 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.DE @@ -0,0 +1,6 @@ +Begin3
+Language: DE, 858
+Title: GNU chcp fonts
+Description: LOADFONT (GNUCHCP) rohe EGA/VGA-Bitmap-Schriftarten fr Textmodi.
+Keywords: loadfont gnuchcp bitmap font ega vga screen schriftart
+End
diff --git a/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.FR b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.FR new file mode 100644 index 0000000..24ef21a --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.FR @@ -0,0 +1,6 @@ +Begin3
+Language: FR, 850
+Title: GNU chcp fonts
+Description: LOADFONT (GNUCHCP) polices bitmap EGA/VGA brutes pour les modes texte.
+Keywords: loadfont gnuchcp bitmap police ega vga ‚cran
+End
diff --git a/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.LSM b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.LSM new file mode 100644 index 0000000..c399da5 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.LSM @@ -0,0 +1,16 @@ +Begin3
+Title: GNU chcp fonts
+Version: 1.0a
+Entered-date: 2013-06-04
+Description: EGA/VGA bitmap fonts for text modes
+Keywords: loadfont gnuchcp bitmap font ega vga screen
+Author: Kurt Zammit
+Maintained-by: Kurt Zammit
+Primary-site: http://zammitsoft.freeservers.com
+Mirror-site: http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/system/
+Original-site: http://zammitsoft.freeservers.com
+Platforms: DOS
+Copying-policy: GNU General Public License, Version 2
+Summary: Raw EGA/VGA bitmap fonts for text modes.
+Modified-date: 2022-02-17.0 +end diff --git a/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.SV b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.SV new file mode 100644 index 0000000..df108ff --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.SV @@ -0,0 +1,6 @@ +Begin3
+Language: SV, 850
+Title: GNU chcp-typsnitt
+Description: LOADFONT (GNUCHCP) r†a EGA-/VGA-bitmappstypsnitt f”r textl„gen.
+Keywords: loadfont gnuchcp bitmapp typsnitt ega vga sk„rm
+End
diff --git a/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.TR b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.TR new file mode 100644 index 0000000..5fee353 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.TR @@ -0,0 +1,6 @@ +Begin3
+Language: TR, 857
+Title: GNU chcp fonts
+Description: Metin kipleri i‡in LOADFONT (GNUCHCP) ham EGA/VGA bitmap yaz tipleri.
+Keywords: loadfont gnuchcp bitmap yaz tipi ega vga ekran
+End
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X10.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X10.FNT Binary files differnew file mode 100644 index 0000000..27216e9 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X10.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X11SNSF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X11SNSF.FNT Binary files differnew file mode 100644 index 0000000..f584fb5 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X11SNSF.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X14.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X14.FNT Binary files differnew file mode 100644 index 0000000..f10237d --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X14.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X8.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X8.FNT Binary files differnew file mode 100644 index 0000000..f0b651e --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X8.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ANTIQUE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ANTIQUE.FNT Binary files differnew file mode 100644 index 0000000..16d304e --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ANTIQUE.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ARCHON.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ARCHON.FNT Binary files differnew file mode 100644 index 0000000..4fc92d7 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ARCHON.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BACKWARD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BACKWARD.FNT Binary files differnew file mode 100644 index 0000000..d078c0d --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BACKWARD.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BIGSERIF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BIGSERIF.FNT Binary files differnew file mode 100644 index 0000000..0e0704f --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BIGSERIF.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLCKSNSF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLCKSNSF.FNT Binary files differnew file mode 100644 index 0000000..1b4f5b0 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLCKSNSF.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLOCK.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLOCK.FNT Binary files differnew file mode 100644 index 0000000..682a2ea --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLOCK.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BOLD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BOLD.FNT Binary files differnew file mode 100644 index 0000000..b9f4728 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BOLD.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BREEZE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BREEZE.FNT Binary files differnew file mode 100644 index 0000000..96ecb0d --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BREEZE.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BROADWAY.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BROADWAY.FNT Binary files differnew file mode 100644 index 0000000..565e4ec --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BROADWAY.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COMPUTER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COMPUTER.FNT Binary files differnew file mode 100644 index 0000000..6862665 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COMPUTER.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COURIER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COURIER.FNT Binary files differnew file mode 100644 index 0000000..fbba1a1 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COURIER.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/CYRILLIC.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/CYRILLIC.FNT Binary files differnew file mode 100644 index 0000000..3c07185 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/CYRILLIC.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/DECO.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/DECO.FNT Binary files differnew file mode 100644 index 0000000..d61c7b9 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/DECO.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EMPTY.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EMPTY.FNT Binary files differnew file mode 100644 index 0000000..85d0ffd --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EMPTY.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EUROTYPE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EUROTYPE.FNT Binary files differnew file mode 100644 index 0000000..a92852f --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EUROTYPE.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FAT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FAT.FNT Binary files differnew file mode 100644 index 0000000..c30c214 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FAT.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FINNISH.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FINNISH.FNT Binary files differnew file mode 100644 index 0000000..ce9723e --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FINNISH.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FLAT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FLAT.FNT Binary files differnew file mode 100644 index 0000000..3c011ae --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FLAT.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRANCE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRANCE.FNT Binary files differnew file mode 100644 index 0000000..23aaf38 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRANCE.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRESNO.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRESNO.FNT Binary files differnew file mode 100644 index 0000000..ca3078b --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRESNO.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-1.FNT Binary files differnew file mode 100644 index 0000000..f835e52 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-1.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-2.FNT Binary files differnew file mode 100644 index 0000000..1a8c9e2 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-2.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/GREEK.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/GREEK.FNT Binary files differnew file mode 100644 index 0000000..63361c6 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/GREEK.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEARST.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEARST.FNT Binary files differnew file mode 100644 index 0000000..59d20da --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEARST.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEBREW.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEBREW.FNT Binary files differnew file mode 100644 index 0000000..0459008 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEBREW.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HYLAS.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HYLAS.FNT Binary files differnew file mode 100644 index 0000000..f5691cc --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HYLAS.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/INVERTED.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/INVERTED.FNT Binary files differnew file mode 100644 index 0000000..e422bb6 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/INVERTED.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ITALICS.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ITALICS.FNT Binary files differnew file mode 100644 index 0000000..ad172ae --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ITALICS.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-1.FNT Binary files differnew file mode 100644 index 0000000..c174343 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-1.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-2.FNT Binary files differnew file mode 100644 index 0000000..c6577dd --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-2.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/LCD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/LCD.FNT Binary files differnew file mode 100644 index 0000000..0d8842b --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/LCD.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MEDIEVAL.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MEDIEVAL.FNT Binary files differnew file mode 100644 index 0000000..ab02bd6 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MEDIEVAL.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-1.FNT Binary files differnew file mode 100644 index 0000000..79f69dc --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-1.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-2.FNT Binary files differnew file mode 100644 index 0000000..90754d5 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-2.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/NORWAY.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/NORWAY.FNT Binary files differnew file mode 100644 index 0000000..9841a46 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/NORWAY.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REV8X8.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REV8X8.FNT Binary files differnew file mode 100644 index 0000000..7c4e21f --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REV8X8.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REVERSE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REVERSE.FNT Binary files differnew file mode 100644 index 0000000..7f6a8a8 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REVERSE.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-1.FNT Binary files differnew file mode 100644 index 0000000..3afa137 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-1.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-2.FNT Binary files differnew file mode 100644 index 0000000..a96eee8 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-2.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSERIF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSERIF.FNT Binary files differnew file mode 100644 index 0000000..57c6176 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSERIF.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSURF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSURF.FNT Binary files differnew file mode 100644 index 0000000..3d55d61 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSURF.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCOTT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCOTT.FNT Binary files differnew file mode 100644 index 0000000..10f235b --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCOTT.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCRIPT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCRIPT.FNT Binary files differnew file mode 100644 index 0000000..f16090d --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCRIPT.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SILVER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SILVER.FNT Binary files differnew file mode 100644 index 0000000..245a008 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SILVER.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STANDARD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STANDARD.FNT Binary files differnew file mode 100644 index 0000000..19ff712 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STANDARD.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STRETCH.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STRETCH.FNT Binary files differnew file mode 100644 index 0000000..4b74341 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STRETCH.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SUPER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SUPER.FNT Binary files differnew file mode 100644 index 0000000..cfcd60f --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SUPER.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SURREAL.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SURREAL.FNT Binary files differnew file mode 100644 index 0000000..821da52 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SURREAL.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-1.FNT Binary files differnew file mode 100644 index 0000000..7267692 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-1.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-2.FNT Binary files differnew file mode 100644 index 0000000..3f540ba --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-2.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-3.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-3.FNT Binary files differnew file mode 100644 index 0000000..1f76137 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-3.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TEKTON.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TEKTON.FNT Binary files differnew file mode 100644 index 0000000..72b3148 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TEKTON.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TERMINUS.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TERMINUS.FNT Binary files differnew file mode 100644 index 0000000..ca93cc7 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TERMINUS.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THAI.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THAI.FNT Binary files differnew file mode 100644 index 0000000..b941e9c --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THAI.FNT diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THIN.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THIN.FNT Binary files differnew file mode 100644 index 0000000..f51ece8 --- /dev/null +++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THIN.FNT diff --git a/src/sliceitoff/game/gameplay.py b/src/sliceitoff/game/gameplay.py index fc0f52b..a7224ca 100644 --- a/src/sliceitoff/game/gameplay.py +++ b/src/sliceitoff/game/gameplay.py @@ -1,11 +1,15 @@ +""" Reads user input and does actions when game play is on. """ import pygame class Gameplay: - def __init__(self, player = None, field = None): + """ Logic of the playfield """ + def __init__(self, player = None, field = None, status = None): + self.status = status self.player = player self.field = field def step(self): + """ Processes events for the step (frame) """ for event in pygame.event.get(): match event.type: case pygame.KEYDOWN: @@ -22,7 +26,9 @@ class Gameplay: case pygame.MOUSEBUTTONDOWN: self.player.set_position(pygame.mouse.get_pos()) if event.button == 1: - if self.player.fire_lazer(): + if ( + self.player.fire_lazer() + and self.status.lose_life() ): return True if event.button == 3: self.player.set_direction() diff --git a/src/sliceitoff/game/level.py b/src/sliceitoff/game/level.py index 97e64cf..28d9b44 100644 --- a/src/sliceitoff/game/level.py +++ b/src/sliceitoff/game/level.py @@ -14,7 +14,7 @@ class Level: self.field = Field() self.enemies = Enemies(field = self.field, level = level) self.player = Player(field = self.field, enemies = self.enemies) - self.gameplay = Gameplay(player = self.player) + self.gameplay = Gameplay(player = self.player, status = self.status ) self.obj_classes = ( self.status, self.field, diff --git a/src/sliceitoff/images/__init__.py b/src/sliceitoff/images/__init__.py index d87dfa0..c11d718 100644 --- a/src/sliceitoff/images/__init__.py +++ b/src/sliceitoff/images/__init__.py @@ -1 +1,2 @@ from .images import Images +from .fonts import Fonts, Font diff --git a/src/sliceitoff/images/fonts.py b/src/sliceitoff/images/fonts.py new file mode 100644 index 0000000..d3d15cf --- /dev/null +++ b/src/sliceitoff/images/fonts.py @@ -0,0 +1,42 @@ +import os +import pygame + +from display import Scaling + +DEBUG = os.getenv("DEBUG") + +class Fonts: + fonts = {} + + @staticmethod + def load_fonts(base_path): + filename_fontlist = os.path.join(base_path, "assets", "fonts.lst") + with open( filename_fontlist ) as fontlist_file: + for line in fontlist_file: + name, *path = line.strip().split() + filename = os.path.join(base_path, *path) + font = Font(filename) + __class__.fonts[name] = Font(filename) + return True + + +class Font: + def __init__(self, filename, height = 16): + if DEBUG: + print(f"Loading font {filename = }") + self.surfaces = [] + with open(filename, mode="rb") as fnt_file: + for _ in range(256): + surface = pygame.Surface((8,height), pygame.SRCALPHA) + for line in range(16): + byte = fnt_file.read(1)[0] + if line >= height: + continue + for bit in range(8): + if byte & 0x80: + surface.set_at((bit,line),"white") + byte <<= 1 + self.surfaces.append(surface) + + def get(self, ch): + return self.surfaces[ch.encode('cp437')[0]%256] diff --git a/src/sliceitoff/status/status.py b/src/sliceitoff/status/status.py index d99c7d5..a63a7db 100644 --- a/src/sliceitoff/status/status.py +++ b/src/sliceitoff/status/status.py @@ -2,20 +2,31 @@ import os import pygame from display import Scaling -from images import Images +from images import Images, Fonts class LetterSprite(pygame.sprite.Sprite): def __init__(self, image, pos): super().__init__() self.image = image self.rect = self.image.get_rect().move(pos) - + +class TextGroup(pygame.sprite.Group): + def __init__(self, text, pos, size = 8_000, spacing = None, font = 'lcd'): + super().__init__() + if spacing == None: + spacing = size + for i in range(len(text)): + image = pygame.transform.scale_by( + Fonts.fonts[font].get(text[i]), + size/8 * Scaling.factor) + image_pos = Scaling.scale_to_display( (pos[0]+i*spacing, pos[1]) ) + self.add(LetterSprite(image, image_pos)) class Status(): def __init__(self, level = 1): self.score = 0 self.bonus = 20_000 - self.health = 3 + self.lives = 3 self.level = level self.sprites = pygame.sprite.Group() @@ -24,12 +35,17 @@ class Status(): self.bonus = max(0, self.bonus - dt) - self.sprites.empty() - y = 280_000 - #score_str="{:010d}".format(self.score) - score_str="{:010d}".format(self.bonus) - for letter, x in zip(score_str, range(300_000,400_000,10_000)): - self.sprites.add(LetterSprite( - Images.surfaces[f"letter_{letter}"], - Scaling.scale_to_display((x,y)) )) - self.updated = False + score_str="LEVEL{:02d}LIVES{:02d}{:010d}".format(self.level, self.lives, self.bonus) + self.sprites = TextGroup( + score_str, + (0, 280_000), + size = 10_000) + + def lose_life(self): + """ Lose 1 life and return true if no lives left """ + self.lives -= 1 + return not self.lives + + def gain_life(self): + """ Gain 1 life """ + self.lives += 1 |