Prev: 39086 Up: Map Next: 39228
39174: Handler: The Block
Animate The Block, or clear the slot once it has moved off the screen in the direction it is travelling.
Input
IX Actor slot
Handler_Block 39174 LD H,(IX+3) Fetch the high byte of the world X.
39177 LD L,(IX+2) Fetch the low byte of the world X.
39180 LD DE,(24698) Fetch Jetman_Position.
39184 AND A Subtract the scroll position.
39185 SBC HL,DE
39187 BIT 7,(IX+5) Jump to Handler_Block_StillOnScreen if the horizontal speed is negative.
39191 JR NZ,Handler_Block_StillOnScreen
39193 LD A,H Fetch the high byte of the gap.
39194 AND %00011111 Keep only bits 0-4.
39196 CP 1 Jump to Handler_Block_ClearType if the alien has left the screen.
39198 JR Z,Handler_Block_ClearType
Select the animation frame for The Block.
Handler_Block_Animation 39200 INC (IX+17) Increase the animation timer.
39203 LD A,(IX+17) Fetch the animation timer.
39206 AND %00000111 Keep only bits 0-2.
Sprite IDs begin at 136 ("The Block: Frame 1").
39208 ADD A,136 Add 136 for these frames.
39210 LD (IX+0),A Write it to the actor type.
39213 JP PlaceSpawnedAlien_Age Jump to PlaceSpawnedAlien_Age.
When The Block is moving left, test whether it has left the left edge.
Handler_Block_StillOnScreen 39216 LD A,H Fetch the high byte of the gap.
39217 OR %11100000 Set bits 5-7.
39219 CP 254 Jump to Handler_Block_Animation if the alien has not left the left edge.
39221 JR NZ,Handler_Block_Animation
This entry point is used by the routine at PlaceSpawnedAlien.
Handler_Block_ClearType 39223 LD (IX+0),0 Write 0 to the actor type.
39227 RET Return.
Prev: 39086 Up: Map Next: 39228