Prev: ABEF Up: Map Next: AC24
AC0E: Animate Actor
Used by the routines at HandlerWulf and HandlerTribesman.
Every other frame, moves an actor on to the next frame of its animation by incrementing the lowest two bits of the sprite ID (so the animation is the four frames of the sprite with the same upper bits).
Input
IX Actor record
AnimateActor AC0E LD A,($9693) Fetch the low byte of the game timer from GameTimer.
AC11 AND %00000001 Keep only bit 0.
AC13 RET NZ Return if bit 0 is set (the actor only animates on alternate passes).
AC14 LD A,(IX+$00) Fetch the sprite ID of the actor.
AC17 LD C,A Stash the sprite ID in C.
AC18 INC A Move on to the next frame.
AC19 AND %00000011 Keep only bits 0-1.
AC1B LD B,A Stash the new frame in B.
AC1C LD A,C Fetch the old sprite ID.
AC1D AND %11111100 Keep only bits 2-7.
AC1F OR B Merge in the new frame.
AC20 LD (IX+$00),A Set the new sprite ID of the actor.
AC23 RET Return.
Prev: ABEF Up: Map Next: AC24