Prev: 41949 Up: Map Next: 41990
41961: Handle Stalactite Hit
Used by the routine at Handle_Sabreman_Walking.
Handles Sabreman being touched by the falling stalactite. It is entered from 42101 with the result of Check_Stalactite_Contact in C. Bit 7 of C is set when the stalactite is on the right of Sabreman or level with him, and bit 0 is set when it is at least 10 pixels away horizontally.
Sabreman is pushed away from the stalactite at a speed of 2. If bit 0 of C is clear (a direct hit), the routine goes to Start_Dying, which turns the sprite into the death sprite. Otherwise he starts to tumble with a jump upwards.
Input
C Result of the stalactite contact check
IX Object record of Sabreman
Handle_Stalactite_Hit 41961 BIT 7,C Jump to Handle_Stalactite_Hit_Move_Left if bit 7 of the contact result is set.
41963 JR NZ,Handle_Stalactite_Hit_Move_Left
41965 LD A,2 A=2 (move to the right).
41967 JR Handle_Stalactite_Hit_Set_Velocity Jump to Handle_Stalactite_Hit_Set_Velocity.
Handle_Stalactite_Hit_Move_Left 41969 LD A,254 A=254 (move to the left).
Handle_Stalactite_Hit_Set_Velocity 41971 LD (IX+6),A Set the x velocity.
41974 BIT 0,C Jump to Start_Dying if the stalactite hit him directly.
41976 JP Z,Start_Dying
41979 LD (IX+0),24 Set the sprite id to 24 (tumbling).
41983 LD (IX+9),192 Set the y velocity to 192 (up).
41987 JP Update_Object_Sprite Jump to Update_Object_Sprite.
Prev: 41949 Up: Map Next: 41990