Prev: 6FBD Up: Map Next: 7007
6FC9: 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 6FC9 CALL CheckCubbyHole Check for a cubby hole using CheckCubbyHole.
6FCC LD A,(IX+$02) A=the Y position of Robbie.
6FCF LD (IX+$0E),A Write it to the new Y position of the spray can.
6FD2 BIT 0,E Jump to Robbie_CarryingCan_Vertical if Robbie is not level with a cubby hole.
6FD4 JP Z,Robbie_CarryingCan_Vertical
6FD7 BIT 2,E Jump to Robbie_CarryingCan_Fire if the cubby hole is not empty.
6FD9 JP NZ,Robbie_CarryingCan_Fire
6FDC LD A,(IX+$01) A=the X position of Robbie.
6FDF BIT 1,E Jump to Robbie_CarryingCan_CubbyColumnLeft if Robbie is on the left hand side.
6FE1 JR Z,Robbie_CarryingCan_CubbyColumnLeft
6FE3 ADD A,$02 Add 02.
6FE5 CP $D8 Jump to PutCanInCubbyHole if Robbie has reached the edge.
6FE7 JR NC,PutCanInCubbyHole
Robbie_CarryingCan_StoreX 6FE9 LD (IX+$01),A Write the new X position.
6FEC LD A,(IX+$09) A=the X position of the spray can.
6FEF ADD A,$02 Add 02.
Robbie_CarryingCan_StoreCanX_Left 6FF1 LD (IX+$0D),A Write it to the new X position of the spray can.
6FF4 JP Robbie_CarryingCan_Fire Jump to Robbie_CarryingCan_Fire.
Robbie_CarryingCan_CubbyColumnLeft 6FF7 SUB $02 Subtract 02.
6FF9 CP $18 Jump to PutCanInCubbyHole if Robbie has reached the edge.
6FFB JR C,PutCanInCubbyHole
6FFD LD (IX+$01),A Write the new X position.
7000 LD A,(IX+$09) A=the X position of the spray can.
7003 SUB $02 Subtract 02.
7005 JR Robbie_CarryingCan_StoreCanX_Left Jump to Robbie_CarryingCan_StoreCanX_Left.
Prev: 6FBD Up: Map Next: 7007