summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-18 16:27:51 +0200
committerViljami Ilola <+@hix.fi>2024-03-18 16:27:51 +0200
commit89bf2bf2197e44f0745bcae1400227c2999573cd (patch)
treeb8c75505a2f860c32b01802dc037fdae2b3f73c5 /src
parent78c665af8b860063658d1782f75e072cfe88c82b (diff)
fonts from fnt-file
Diffstat (limited to 'src')
-rw-r--r--src/sliceitoff/__main__.py6
-rw-r--r--src/sliceitoff/assets/fonts.lst1
-rw-r--r--src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.DE6
-rw-r--r--src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.FR6
-rw-r--r--src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.LSM16
-rw-r--r--src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.SV6
-rw-r--r--src/sliceitoff/assets/gnufonts/APPINFO/GNUFONTS.TR6
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X10.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X11SNSF.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X14.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X8.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ANTIQUE.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ARCHON.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BACKWARD.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BIGSERIF.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLCKSNSF.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLOCK.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BOLD.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BREEZE.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BROADWAY.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COMPUTER.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COURIER.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/CYRILLIC.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/DECO.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EMPTY.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EUROTYPE.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FAT.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FINNISH.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FLAT.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRANCE.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRESNO.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-1.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-2.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/GREEK.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEARST.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEBREW.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HYLAS.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/INVERTED.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ITALICS.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-1.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-2.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/LCD.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MEDIEVAL.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-1.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-2.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/NORWAY.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REV8X8.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REVERSE.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-1.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-2.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSERIF.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSURF.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCOTT.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCRIPT.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SILVER.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STANDARD.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STRETCH.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SUPER.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SURREAL.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-1.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-2.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-3.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TEKTON.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TERMINUS.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THAI.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THIN.FNTbin0 -> 4096 bytes
-rw-r--r--src/sliceitoff/game/gameplay.py10
-rw-r--r--src/sliceitoff/game/level.py2
-rw-r--r--src/sliceitoff/images/__init__.py1
-rw-r--r--src/sliceitoff/images/fonts.py42
-rw-r--r--src/sliceitoff/status/status.py40
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
new file mode 100644
index 0000000..27216e9
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X10.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X11SNSF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X11SNSF.FNT
new file mode 100644
index 0000000..f584fb5
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X11SNSF.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X14.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X14.FNT
new file mode 100644
index 0000000..f10237d
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X14.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X8.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X8.FNT
new file mode 100644
index 0000000..f0b651e
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/8X8.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ANTIQUE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ANTIQUE.FNT
new file mode 100644
index 0000000..16d304e
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ANTIQUE.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ARCHON.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ARCHON.FNT
new file mode 100644
index 0000000..4fc92d7
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ARCHON.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BACKWARD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BACKWARD.FNT
new file mode 100644
index 0000000..d078c0d
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BACKWARD.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BIGSERIF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BIGSERIF.FNT
new file mode 100644
index 0000000..0e0704f
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BIGSERIF.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLCKSNSF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLCKSNSF.FNT
new file mode 100644
index 0000000..1b4f5b0
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLCKSNSF.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLOCK.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLOCK.FNT
new file mode 100644
index 0000000..682a2ea
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BLOCK.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BOLD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BOLD.FNT
new file mode 100644
index 0000000..b9f4728
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BOLD.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BREEZE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BREEZE.FNT
new file mode 100644
index 0000000..96ecb0d
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BREEZE.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BROADWAY.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BROADWAY.FNT
new file mode 100644
index 0000000..565e4ec
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/BROADWAY.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COMPUTER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COMPUTER.FNT
new file mode 100644
index 0000000..6862665
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COMPUTER.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COURIER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COURIER.FNT
new file mode 100644
index 0000000..fbba1a1
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/COURIER.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/CYRILLIC.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/CYRILLIC.FNT
new file mode 100644
index 0000000..3c07185
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/CYRILLIC.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/DECO.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/DECO.FNT
new file mode 100644
index 0000000..d61c7b9
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/DECO.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EMPTY.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EMPTY.FNT
new file mode 100644
index 0000000..85d0ffd
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EMPTY.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EUROTYPE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EUROTYPE.FNT
new file mode 100644
index 0000000..a92852f
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/EUROTYPE.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FAT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FAT.FNT
new file mode 100644
index 0000000..c30c214
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FAT.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FINNISH.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FINNISH.FNT
new file mode 100644
index 0000000..ce9723e
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FINNISH.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FLAT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FLAT.FNT
new file mode 100644
index 0000000..3c011ae
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FLAT.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRANCE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRANCE.FNT
new file mode 100644
index 0000000..23aaf38
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRANCE.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRESNO.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRESNO.FNT
new file mode 100644
index 0000000..ca3078b
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FRESNO.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-1.FNT
new file mode 100644
index 0000000..f835e52
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-1.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-2.FNT
new file mode 100644
index 0000000..1a8c9e2
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/FUTURA-2.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/GREEK.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/GREEK.FNT
new file mode 100644
index 0000000..63361c6
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/GREEK.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEARST.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEARST.FNT
new file mode 100644
index 0000000..59d20da
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEARST.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEBREW.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEBREW.FNT
new file mode 100644
index 0000000..0459008
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HEBREW.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HYLAS.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HYLAS.FNT
new file mode 100644
index 0000000..f5691cc
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/HYLAS.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/INVERTED.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/INVERTED.FNT
new file mode 100644
index 0000000..e422bb6
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/INVERTED.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ITALICS.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ITALICS.FNT
new file mode 100644
index 0000000..ad172ae
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ITALICS.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-1.FNT
new file mode 100644
index 0000000..c174343
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-1.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-2.FNT
new file mode 100644
index 0000000..c6577dd
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/KIDS-2.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/LCD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/LCD.FNT
new file mode 100644
index 0000000..0d8842b
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/LCD.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MEDIEVAL.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MEDIEVAL.FNT
new file mode 100644
index 0000000..ab02bd6
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MEDIEVAL.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-1.FNT
new file mode 100644
index 0000000..79f69dc
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-1.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-2.FNT
new file mode 100644
index 0000000..90754d5
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/MODERN-2.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/NORWAY.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/NORWAY.FNT
new file mode 100644
index 0000000..9841a46
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/NORWAY.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REV8X8.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REV8X8.FNT
new file mode 100644
index 0000000..7c4e21f
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REV8X8.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REVERSE.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REVERSE.FNT
new file mode 100644
index 0000000..7f6a8a8
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/REVERSE.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-1.FNT
new file mode 100644
index 0000000..3afa137
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-1.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-2.FNT
new file mode 100644
index 0000000..a96eee8
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/ROMAN-2.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSERIF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSERIF.FNT
new file mode 100644
index 0000000..57c6176
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSERIF.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSURF.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSURF.FNT
new file mode 100644
index 0000000..3d55d61
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SANSURF.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCOTT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCOTT.FNT
new file mode 100644
index 0000000..10f235b
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCOTT.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCRIPT.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCRIPT.FNT
new file mode 100644
index 0000000..f16090d
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SCRIPT.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SILVER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SILVER.FNT
new file mode 100644
index 0000000..245a008
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SILVER.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STANDARD.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STANDARD.FNT
new file mode 100644
index 0000000..19ff712
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STANDARD.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STRETCH.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STRETCH.FNT
new file mode 100644
index 0000000..4b74341
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/STRETCH.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SUPER.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SUPER.FNT
new file mode 100644
index 0000000..cfcd60f
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SUPER.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SURREAL.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SURREAL.FNT
new file mode 100644
index 0000000..821da52
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SURREAL.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-1.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-1.FNT
new file mode 100644
index 0000000..7267692
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-1.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-2.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-2.FNT
new file mode 100644
index 0000000..3f540ba
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-2.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-3.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-3.FNT
new file mode 100644
index 0000000..1f76137
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/SWISS-3.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TEKTON.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TEKTON.FNT
new file mode 100644
index 0000000..72b3148
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TEKTON.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TERMINUS.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TERMINUS.FNT
new file mode 100644
index 0000000..ca93cc7
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/TERMINUS.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THAI.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THAI.FNT
new file mode 100644
index 0000000..b941e9c
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THAI.FNT
Binary files differ
diff --git a/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THIN.FNT b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THIN.FNT
new file mode 100644
index 0000000..f51ece8
--- /dev/null
+++ b/src/sliceitoff/assets/gnufonts/UTIL/GNUFONTS/THIN.FNT
Binary files differ
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