Prev: 36397 Up: Map Next: 36638
36554: Apply Player Collision
Used by the routine at ApplyCollisionEffects.
Part of ApplyCollisionEffects, used when the value in ScratchValue is zero. Only objects of type 19 are dealt with here. Purpose not yet known.
Input
IX Address of the object
IY Address of the player's object
ApplyPlayerCollision 36554 LD A,(IX+0) Fetch the type of the object.
36557 CP 19 Is it 19?
36559 RET NZ Return if not.
36560 LD A,(62967) Fetch the value from 62967.
36563 AND A Test it.
36564 RET Z Return if it is zero.
36565 LD A,(51453) Fetch the value from 51453.
36568 XOR (IX+7) Combine the sign with the horizontal speed of the object.
36571 BIT 7,A Test bit 7.
36573 RET NZ Return if it is set.
36574 LD A,(49788) Fetch the value from 49788.
36577 LD H,A Use it as the horizontal position.
36578 LD A,(49789) Fetch the value from PieceVariables_SecondSprite.
36581 ADD A,8 Add eight.
36583 LD L,A Use it as the vertical position.
36584 LD A,80 A=80.
36586 CALL LimitHeight Work out the position.
36589 LD E,B Use the result as the height.
36590 LD D,12 Set the width to 12.
36592 LD IX,43940 Use the hit data at CollisionBox.
36596 CALL TestBoxesOverlap Check for a hit.
36599 LD A,(23580) Fetch the value from ScratchValue.
36602 AND A Test it.
36603 RET Z Return if it is zero.
36604 LD A,128 Set CollisionKind to 128.
36606 LD (53436),A
36609 LD IX,(44358) Fetch the address of the object that was hit from CurrentObject.
36613 LD H,(IX+7) Fetch its horizontal speed into HL.
36616 LD L,(IX+8)
36619 CALL NegateNumber Negate it.
36622 SRA H Halve it.
36624 RR L
36626 LD (IY+25),H Give the result to the player as horizontal speed.
36629 LD (IY+26),L
36632 LD A,255 Set Variables to 255.
36634 LD (23616),A
36637 RET Return.
Prev: 36397 Up: Map Next: 36638