+ ; applies gravity to an actor
+ ; sets act_direction to DOWN
+ ; inputs:
+ ; de: actor
+act_apply_gravity:
+ ld a, [col_direction]
+ and a, DIRUP
+ ret nz
+
+ ld a, [col_direction]
+ or a, DIRDOWN
+ ld [col_direction], a
+
+ ld hl, act_pos_y
+ add hl, de
+ ld a, [hl]
+ inc a
+ ld [hl], a
+ ret
+
; stores current position in col_prev_pos
; inputs:
; de: actor
push de
; top left point
- _act_tile_col_check col_point_tl, (-1 & 0xFF), 0, @collision
+ _act_tile_col_check col_point_tl, (1 & 0xFF), 0, @collision
; bottom left point
_act_tile_col_check col_point_bl, (-1 & 0xFF), 0, @collision
push de
; top right point
- _act_tile_col_check col_point_tr, (-1 & 0xFF), 0, @collision
+ _act_tile_col_check col_point_tr, (1 & 0xFF), 0, @collision
; bottom right point
_act_tile_col_check col_point_br, (-1 & 0xFF), 0, @collision
push de
; top left point
- _act_tile_col_check col_point_tl, 0, (-1 & 0xFF), @collision
+ _act_tile_col_check col_point_tl, 0, (1 & 0xFF), @collision
; top right point
_act_tile_col_check col_point_tr, 0, (-1 & 0xFF), @collision
push de
; bottom left point
- _act_tile_col_check col_point_bl, 0, (-1 & 0xFF), @collision
+ _act_tile_col_check col_point_bl, 0, (1 & 0xFF), @collision
; bottom rihgt point
_act_tile_col_check col_point_br, 0, (-1 & 0xFF), @collision