# Known Bugs
-## Objects are out of bounds
-
-Sometimes objects are flickering at tile 0/0.
-
-## When hitting an actor the delay timer is too long
-
-When the player runs into an actor the movement delay triggeered
-is way longer than expected.
; actor initiative based on tile flags
; actor position
unit_try_move_up:
+ ; enable subtile up
+ ld a, 0b10100000
+ push de
+ call unit_set_delay_to_active_speed
+ pop de
+
; y - 1
unit_test_collision dec b, CF_COLLISION
dec a
ld [hl], a
- ; enable subtile up
- ld a, 0b10100000
- call unit_set_delay_to_active_speed
ret
unit_try_move_down:
+ ; enable subtile down
+ push de
+ ld a, 0b01100000
+ call unit_set_delay_to_active_speed
+ pop de
+
; y + 1
unit_test_collision inc b, CF_COLLISION
inc a
ld [hl], a
-
- ; enable subtile down
- ld a, 0b01100000
- call unit_set_delay_to_active_speed
ret
unit_try_move_left:
+ ; enable subtile left
+ push de
+ ld a, 0b00110000
+ call unit_set_delay_to_active_speed
+ pop de
+
; x - 1
unit_test_collision dec c, CF_COLLISION
dec a
ld [hl], a
-
- ; enable subtile left
- ld a, 0b00110000
- call unit_set_delay_to_active_speed
ret
unit_try_move_right:
-
+ ; enable subtile right
+ push de
+ ld a, 0b00101000
+ call unit_set_delay_to_active_speed
+ pop de
+
; x + 1
unit_test_collision inc c, CF_COLLISION
inc a
ld [hl], a
- ; enable subtile right
- ld a, 0b00101000
- call unit_set_delay_to_active_speed
-
ret