ld [actor_soam_ptr], a
#endmacro
- ; loads an animation frame
- ; from a table
- ; uses hl and a
- ; inputs:
- ; $1: table
- ; $2: max frames (mask)
- ; returns:
- ; a: the frame
-#macro load_anim_frame
- ld hl, $1
- ld a, [frame_count]
- and a, $2 ; max frames
- ld d, 0
- ld e, a
- add hl, de ; hl = correct tile index
- ld a, [hl]
-#endmacro
-
actor_anim_table_bat:
.db BAT_TILE_IDLE1
.db BAT_TILE_IDLE1
.db BAT_TILE_IDLE2
.db BAT_TILE_IDLE2
.db BAT_TILE_IDLE2
-.db BAT_TILE_IDLE2
; function ptrs for each actor type
.def int PLAYER_TILE_IDLE1 = 0x00
.def int PLAYER_TILE_IDLE2 = 0x12
+.def int PLAYER_TILE_MOVE_FRAME1_1 = 0x02
+.def int PLAYER_TILE_MOVE_FRAME2_1 = 0x10
+
+player_anim_table1:
+.rep c, 2, 1, .db PLAYER_TILE_IDLE1
+.rep c, 7, 1, .db PLAYER_TILE_MOVE_FRAME1_1
+.rep c, 7, 1, .db PLAYER_TILE_MOVE_FRAME2_1
+
#define PLAYER_IFRAME_TIMER 64
#define DAMAGE_ANIM_LEN 20
push de
; 2) hl = player_y already
- ; 3) load correct collision points
+; 3) load correct collision points
ld de, $1
call collision_tile_table_check
pop de
ret
@draw_visible:
+ ; load left tile into tmp
+ push de
+ load_anim_frame player_anim_table1, 0b1111
+ ld [tmp], a
+ pop de
+
; drawing
; set up obj flag mask based on frame counter
ld [hl+], a
; idel tile 1
- ld a, PLAYER_TILE_IDLE1
+ ld a, [tmp]
ld [hl+], a
; flags