sprites: Added build step for sprite overlays
authorLukas Krickl <lukas@krickl.dev>
Sun, 4 Jan 2026 11:35:39 +0000 (12:35 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 4 Jan 2026 11:35:39 +0000 (12:35 +0100)
README.md
makefile
sprites/sword.inc [new file with mode: 0644]
src/main.s
src/sprites.s [new file with mode: 0644]

index ce5b5df66098a3e005fffdd7144a22ade47264d2..e85e047bd72a0cb0d696224a7c2b7bc2418a46ab 100644 (file)
--- a/README.md
+++ b/README.md
@@ -22,6 +22,14 @@ This game is compatible with any gameboy emulator.
 To build the assets simply check out the `assets repository` into the `assets` directory and run `make tiles`.
 This is only required if changes to the tileset were made. All 'compiled' tile directories are already included in this repository!
 
+### Directory structure
+
+- src:  all source files
+- maps: generated map files used for rendering the game field
+- levels: generated level files
+- tiles: generated tilesets
+- sprites: generated sprite overlay templates
+
 ## License
 
 This program is distributed under the terms of the MIT License.
index 60497e9d80c1febd9ae5f341d83f07fc714d3eb4..e667bb1e2461646dfc89afe0a474ca31b8a50dc6 100644 (file)
--- a/makefile
+++ b/makefile
@@ -4,7 +4,7 @@ AS=ulas
 FLAGS=-D DEBUG
 #SYMTYPE=sym
 SYMTYPE=mlb
-INCS=-I ./src -I ./tiles -I ./maps -I ./levels
+INCS=-I ./src -I ./tiles -I ./maps -I ./levels -I ./sprites
 
 bin:
        $(AS) $(FLAGS) -o $(NAME).gb -l ${NAME}.lst -s $(NAME).$(SYMTYPE) -S $(SYMTYPE) $(INCS) src/main.s
@@ -51,3 +51,7 @@ maps:
 .PHONY: levels
 levels:
        ./tools/tmx2map.py assets/levels/l1.tmx > levels/l1.inc
+
+.PHONY: sprites
+sprites:
+       ./tools/tmx2map.py assets/sprites/sword.tmx > sprites/sword.inc
diff --git a/sprites/sword.inc b/sprites/sword.inc
new file mode 100644 (file)
index 0000000..c3c8394
--- /dev/null
@@ -0,0 +1,4 @@
+; this map was generated by tmx2map.py
+
+.db -0x42, -0x51, -0x51, -0x51, -0x33, -0x42, -0x51, -0x31, -0x51, -0x33, -0x32, -0x51, -0x51, -0x22, -0x51, -0x21
+
index 699401dc2b03b10537ec24379df05449f2b2eb8e..01dc4862873bf70be55a72d1e716f27b7a228a02 100644 (file)
@@ -70,6 +70,7 @@ main:
 #include "levels.s"
 #include "attributes.s"
 #include "item.s"
+#include "sprites.s"
 
 #include "tiles.inc"
 #include "text.s"
diff --git a/src/sprites.s b/src/sprites.s
new file mode 100644 (file)
index 0000000..057b2dc
--- /dev/null
@@ -0,0 +1,4 @@
+       ; this file contains rendering code for sprite overlays
+       ; this can be e.g. weapons displayed in first person view
+
+#include "sword.inc"