From: Lukas Krickl Date: Thu, 22 Jan 2026 04:48:22 +0000 (+0100) Subject: map: Added blood tile X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=04c9d6fa822744e0ab5f4b0d4e4f73257e1052f9;p=gbrg%2F.git map: Added blood tile --- diff --git a/assets b/assets index c85a7a2..5886404 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit c85a7a2d1bd18cb702f347819b838c8ad9d9fb97 +Subproject commit 5886404a9d1e6893c4dd58d3d19170f67ec00aa4 diff --git a/maps/l1.inc b/maps/l1.inc index b160c3e..d82b6b2 100644 --- a/maps/l1.inc +++ b/maps/l1.inc @@ -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 diff --git a/src/defs.s b/src/defs.s index 1f9e0d9..e393f1a 100644 --- a/src/defs.s +++ b/src/defs.s @@ -136,6 +136,9 @@ ; 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 diff --git a/src/player.s b/src/player.s index 21fa61e..f321b40 100644 --- a/src/player.s +++ b/src/player.s @@ -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 diff --git a/src/tiles.s b/src/tiles.s index 66a2d3b..889fdc5 100644 --- a/src/tiles.s +++ b/src/tiles.s @@ -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 diff --git a/tiles/bank9000.inc b/tiles/bank9000.inc index 1702d2f..f672b39 100644 --- a/tiles/bank9000.inc +++ b/tiles/bank9000.inc @@ -37,12 +37,12 @@ .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 @@ -612,14 +612,14 @@ .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