From 9d1d8b1e7c4c39d0193a134454f9544610c9ff66 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 26 Jan 2025 06:17:07 +0100 Subject: [PATCH] animation: Added basic docs for animations --- src/animation.s | 15 ++++++++++++++- src/update.s | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) 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 -- 2.30.2