Prev: B31A Up: Map Next: B33F
B31F: Handle Rising Block
The handler for a block which moves up and down when the player is standing on it (object 2F). The highest point it reaches is 30 above its height when it was first handled, which is kept in BlockScratch. A block which has not been touched and has not landed is left alone.
Input
IX The address of the object
Set BlockScratch the first time this block is handled.
HandleRisingBlock B31F CALL SetPixelAdjustments Call SetPixelAdjustments.
B322 LD A,($5B25) Fetch BlockScratch.
B325 AND A Jump to HandleRisingBlock_TestTouched if it is not zero.
B326 JR NZ,HandleRisingBlock_TestTouched
B328 LD A,(IX+$03) Fetch the height of the block.
B32B ADD A,$30 Add 30.
B32D LD ($5B25),A Set BlockScratch.
Leave the block alone unless it has been touched or has landed.
HandleRisingBlock_TestTouched B330 BIT 3,(IX+$0D) Test bit 3 of the state.
B334 RES 3,(IX+$0D) Reset bit 3 of the state.
B338 JR NZ,HandleMovingBlock_Move Jump to HandleMovingBlock_Move if something touched the block.
B33A BIT 2,(IX+$0C) Return if the block has not landed.
B33E RET Z
Continue on to HandleMovingBlock.
Prev: B31A Up: Map Next: B33F