Prev: 6653 Up: Map Next: 6681
6669: Handle Monster Falling
State 02 of the monster; it moves down four pixels at a time until it is back inside the dustbin. A random delay (01 to 0F frames) is then set, and the monster moves on to the next state.
Input
IX Actor
HandleMonster_Falling 6669 LD A,(IX+$02) Fetch the vertical co-ordinate.
666C ADD A,$04 Lower the monster by 04 pixels.
666E CP $B8 Jump to HandleMonster_StartDelay if the monster is back inside the dustbin.
6670 JR NC,HandleMonster_StartDelay
6672 JR HandleMonster_Move Jump to HandleMonster_Move to move the monster.
HandleMonster_StartDelay 6674 LD A,R Fetch a random number.
6676 AND %00001111 Keep only bits 0-3.
6678 OR %00000001 Set bit 0, so that the timer is never zero.
667A LD (IX+$07),A Write the random number to the timer (byte 07 of the actor).
667D INC (IX+$06) Increase the actor state by one.
6680 RET Return.
Prev: 6653 Up: Map Next: 6681