Prev: EBB5 Up: Map Next: EBDE
EBC0: Start Tumbling Inside Walls
Used by the routine at Handle_Sabreman_Falling.
Makes Sabreman tumble (see Handle_Sabreman_Tumbling) when he is knocked about while he jumps or falls. The type of the object is set to 18 which is the first frame of the tumbling Sabreman.
The x position is then limited so that he does not tumble into the wall: it is kept below C0 when the room has a wall on the right, and below E8 when it does not.
Input
IX Object record of Sabreman
Start_Tumbling_Inside_Walls EBC0 LD (IX+$00),$18 Set the type of the object to 18 the tumbling Sabreman.
EBC4 CALL Read_World_Map Fetch the frame flags of the room into E.
EBC7 BIT 2,E Test bit 2 of the frame flags, which is set when the room has a wall on the right.
EBC9 LD A,(IX+$01) Fetch the x position of the object.
EBCC JR Z,Start_Tumbling_Inside_Walls_No_Wall Jump to Start_Tumbling_Inside_Walls_No_Wall if there is no wall on the right.
EBCE CP $C0 Return if the x position is less than C0.
EBD0 RET C
EBD1 LD (IX+$01),$C0 Limit the x position to C0.
EBD5 RET Return.
Start_Tumbling_Inside_Walls_No_Wall EBD6 CP $E8 Return if the x position is less than E8.
EBD8 RET C
EBD9 LD (IX+$01),$E8 Limit the x position to E8.
EBDD RET Return.
Prev: EBB5 Up: Map Next: EBDE