map: Added blood tile
authorLukas Krickl <lukas@krickl.dev>
Thu, 22 Jan 2026 04:48:22 +0000 (05:48 +0100)
committerLukas Krickl <lukas@krickl.dev>
Thu, 22 Jan 2026 04:48:22 +0000 (05:48 +0100)
assets
maps/l1.inc
src/defs.s
src/player.s
src/tiles.s
tiles/bank9000.inc

diff --git a/assets b/assets
index c85a7a2d1bd18cb702f347819b838c8ad9d9fb97..5886404a9d1e6893c4dd58d3d19170f67ec00aa4 160000 (submodule)
--- a/assets
+++ b/assets
@@ -1 +1 @@
-Subproject commit c85a7a2d1bd18cb702f347819b838c8ad9d9fb97
+Subproject commit 5886404a9d1e6893c4dd58d3d19170f67ec00aa4
index b160c3e6f01f380f022c24b381073ecc6bd7882b..d82b6b23beac5d223c37f1df1e7f1e661a917b6c 100644 (file)
@@ -1,7 +1,7 @@
 ; this map was generated by tmx2map.py
 
 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
-.db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0
+.db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0
 .db 0x1, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x1, 0x1, 0x2, 0x1, 0x2, 0x1, 0x1, 0x1, 0x1, 0x2, 0x1, 0x2, 0x1
 .db 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x1
index 1f9e0d9123ea1f95ebc5040d2ecf575f9be7f66b..e393f1aa7040ea837f88a65838242d29e9467e99 100644 (file)
        ; this marks the end of a room
        ; doors turn into this tile type
 .de TT_ROOM_END, 1
+       ; when an enemy is killed the tile 
+       ; it perviously occupied gets this flag
+.de TT_BLOOD, 1
 
 
        ; tile flags0
index 21fa61e5a2e6fa91077aa1dde2d831fbdf1bf20a..f321b4021b24dc8326a16c39f971d956aa8603a3 100644 (file)
@@ -142,9 +142,30 @@ player_draw:
 
        ret
 
+       ; loads the target tile position
+       ; returns:
+       ;               bc: y/x
+player_load_target_tile:
+       ld a, [player_target_y]
+       ld b, a
+       ld a, [player+act_pos_y]
+       add a, b 
+       ld b, a ; b = y
+
+       ld a, [player_target_x]
+       ld c, a
+       ld a, [player+act_pos_x]
+       add a, c
+       ld c, a ; c = x
+
+       ret
+
        
        ; player attack call
 player_attack:
+       call player_load_target_tile
+       call map_get_tile
+
        ret
        
        ; moves the player 
index 66a2d3b0fcd046d24c47609bb2124f8456167646..889fdc5e5dbfb5d54984cff59e8119293e0652e9 100644 (file)
@@ -20,6 +20,10 @@ tile_door:
 tile_room_end:
        tiledef TT_FLOOR, 0, 0, 1
 
+tile_blood:
+       tiledef TT_BLOOD, 0, 0, 0
+       
+
        ; table of map tiles -> actual tile defs
 tile_table:
        dw tile_wall
@@ -27,6 +31,7 @@ tile_table:
        dw tile_door
        dw tile_inner_wall
        dw tile_room_end
+       dw tile_blood
 
        ; map of tile type to gfx
        ; this is the base tile 
@@ -47,4 +52,6 @@ tile_gfx_table:
        .db 0x01
        ; room end
        .db 0x02
+       ; blood
+       .db 0x04
 
index 1702d2f5fba5ed3589fea5a59b97e780d1bc55bd..f672b39462383815511790d7ddd2062b40f05835 100644 (file)
 .chr 33333333
 ; tile 4
 .chr 00000000
+.chr 03000000
 .chr 00000000
+.chr 00300300
 .chr 00000000
 .chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
+.chr 00300030
 .chr 00000000
 ; tile 5
 .chr 00000000
 .chr 31111113
 .chr 33333333
 ; tile 68
-.chr 00000000
-.chr 00333000
-.chr 03333300
-.chr 01111100
-.chr 01331100
-.chr 01331100
-.chr 01331100
-.chr 00000000
+.chr 11111111
+.chr 11111111
+.chr 11111111
+.chr 11111111
+.chr 11111111
+.chr 11111111
+.chr 11111111
+.chr 11111111
 ; tile 69
 .chr 00000000
 .chr 00000000