From: Lukas Krickl Date: Sun, 17 Nov 2024 07:39:29 +0000 (+0100) Subject: Removed unused collision code X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=a94fe7178f8185a0c9ffb00abe2dca3807e11c6f;p=gbrg%2F.git Removed unused collision code --- diff --git a/TODO.md b/TODO.md index ff2e778..befbea1 100644 --- a/TODO.md +++ b/TODO.md @@ -6,6 +6,10 @@ - PLayer moves from one tile to another - Let animations play and then update AI actors after player move - Collision can then only use a single coordinate to check +- Animation system: + - while an animation is playing the game is stopped + - animations are queued in an animation queue with some simple parameters + ## dungeon generator diff --git a/src/collision.s b/src/collision.s index 32abae4..56f1869 100644 --- a/src/collision.s +++ b/src/collision.s @@ -178,50 +178,3 @@ collision_tile: ret - ; this macro executes the copy-pasted code for each point of the rectangle - ; inputs: - ; $1: c/nc -> indicate greater or less than for y - ; $2: c/nc -> indicate greater or less than for x - ; $3: jump target if no collision occured (relative label) -#macro collision_pt_rec_check - ; -> y pos - ld a, [hl+] - add a, b ; a = rec y + y offset - cp a, d ; cp tl py? - jr $1, $3 REL - - ; -> x pos - ld a, [hl+] - add a, c ; a = rec x + x offset - cp a, e ; cp t1 px? - jr $2, $3 REL -#endmacro - - ; check collision between - ; a point and a provided rectangle - ; inputs: - ; d: point y - ; e: point x - ; b: rec y - ; c: rec x - ; hl: ptr to point 0-3 in the rectangle - ; in this order: - ; top left, top right - ; bottom left, bottom right - ; returns: - ; a = 0 -> no collision - ; a = 1 -> collision -collision_pt_rec: -@top_left: - collision_pt_rec_check nc, nc, @no_collision -@top_right: - collision_pt_rec_check nc, c, @no_collision -@bottom_left: - collision_pt_rec_check c, nc, @no_collision -@bottom_right: - collision_pt_rec_check c, c, @no_collision -@collision: - ld a, 1 -@no_collision: - xor a, a - ret