From: Lukas Krickl Date: Mon, 8 Sep 2025 21:10:39 +0000 (+0200) Subject: animation: added basic delay for animation X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=3cd5d37ad2f3b7a7509a13c7a1e94c9e4ec31bc5;p=gbrg%2F.git animation: added basic delay for animation This probably needs a real animation timer per frame --- diff --git a/src/animation.s b/src/animation.s index 604be83..0af7074 100644 --- a/src/animation.s +++ b/src/animation.s @@ -2,8 +2,13 @@ player_anim_table: anim_ent 0, 8, 0x8C, OAM_FXFLIP anim_ent 0, 0, 0x8E, OAM_FXFLIP anim_ent 0, 0, 0x00, 0 - dw player_anim_table + dw player_anim_table_f2 +player_anim_table_f2: + anim_ent 1, 8, 0x8C, OAM_FXFLIP + anim_ent 1, 0, 0x8E, OAM_FXFLIP + anim_ent 0, 0, 0x00, 0 + dw player_anim_table ; translates tile to screen ; inputs: @@ -94,14 +99,21 @@ unit_draw: call unit_draw_obj call unit_draw_obj call unit_draw_obj - + ; load next anim table + ; every few frames + ld a, [frame_count] + cp a, 4 + jr nz, @no_new_frame REL + ld hl, act_anim_table + add hl, de ld a, [bc] ld [hl+], a inc bc ld a, [bc] ld [hl], a +@no_new_frame: ret ; draws a single object