From: Lukas Krickl Date: Sun, 4 Jan 2026 11:35:39 +0000 (+0100) Subject: sprites: Added build step for sprite overlays X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=dee63a836fb8e74683d63cf1046e588346336992;p=gbrg%2F.git sprites: Added build step for sprite overlays --- diff --git a/README.md b/README.md index ce5b5df..e85e047 100644 --- 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. diff --git a/makefile b/makefile index 60497e9..e667bb1 100644 --- 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 index 0000000..c3c8394 --- /dev/null +++ b/sprites/sword.inc @@ -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 + diff --git a/src/main.s b/src/main.s index 699401d..01dc486 100644 --- a/src/main.s +++ b/src/main.s @@ -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 index 0000000..057b2dc --- /dev/null +++ b/src/sprites.s @@ -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"