From: Lukas Krickl Date: Sun, 26 Jan 2025 05:17:07 +0000 (+0100) Subject: animation: Added basic docs for animations X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=9d1d8b1e7c4c39d0193a134454f9544610c9ff66;p=gbrg%2F.git animation: Added basic docs for animations --- diff --git a/src/animation.s b/src/animation.s index 1195698..af39d63 100644 --- a/src/animation.s +++ b/src/animation.s @@ -2,6 +2,19 @@ ; each frame the latest animation is ; updated - ; updates the current animation + ; updates the current animation + ; an animation is a simple pointer + ; to an update function + ; and a range of parameters (4 freely usable bytes) + ; the animation updte function is expected + ; to set itself to 0000 when the animation is finisehd + ; this is how anim_finished performs its check anim_update: ret + + ; checks if the current animation is finished + ; returns: + ; a: 0 -> animation playing + ; a: 1 -> animation finished +anim_finished: + ret diff --git a/src/update.s b/src/update.s index ad43149..b4d7d19 100644 --- a/src/update.s +++ b/src/update.s @@ -10,6 +10,8 @@ update_game_over: update_game: ; tick rng every frame call rand + + call anim_update ; update player ld hl, player