Prev: 28605 Up: Map Next: 28679
28617: Move Robbie Into Cubby Hole
Used by the routines at Robbie_CarryingCan_Right and Robbie_CarryingCan_Left.
Robbie has walked into one of the cubby hole columns while carrying a can. If he is level with a cubby hole which is empty, he keeps on going until he reaches the edge and puts the can in the hole.
Input
IX Robbie object
Robbie_CarryingCan_CubbyColumn 28617 CALL CheckCubbyHole Check for a cubby hole using CheckCubbyHole.
28620 LD A,(IX+2) A=the Y position of Robbie.
28623 LD (IX+14),A Write it to the new Y position of the spray can.
28626 BIT 0,E Jump to Robbie_CarryingCan_Vertical if Robbie is not level with a cubby hole.
28628 JP Z,Robbie_CarryingCan_Vertical
28631 BIT 2,E Jump to Robbie_CarryingCan_Fire if the cubby hole is not empty.
28633 JP NZ,Robbie_CarryingCan_Fire
28636 LD A,(IX+1) A=the X position of Robbie.
28639 BIT 1,E Jump to Robbie_CarryingCan_CubbyColumnLeft if Robbie is on the left hand side.
28641 JR Z,Robbie_CarryingCan_CubbyColumnLeft
28643 ADD A,2 Add 2.
28645 CP 216 Jump to PutCanInCubbyHole if Robbie has reached the edge.
28647 JR NC,PutCanInCubbyHole
Robbie_CarryingCan_StoreX 28649 LD (IX+1),A Write the new X position.
28652 LD A,(IX+9) A=the X position of the spray can.
28655 ADD A,2 Add 2.
Robbie_CarryingCan_StoreCanX_Left 28657 LD (IX+13),A Write it to the new X position of the spray can.
28660 JP Robbie_CarryingCan_Fire Jump to Robbie_CarryingCan_Fire.
Robbie_CarryingCan_CubbyColumnLeft 28663 SUB 2 Subtract 2.
28665 CP 24 Jump to PutCanInCubbyHole if Robbie has reached the edge.
28667 JR C,PutCanInCubbyHole
28669 LD (IX+1),A Write the new X position.
28672 LD A,(IX+9) A=the X position of the spray can.
28675 SUB 2 Subtract 2.
28677 JR Robbie_CarryingCan_StoreCanX_Left Jump to Robbie_CarryingCan_StoreCanX_Left.
Prev: 28605 Up: Map Next: 28679