- 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
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