Prev: 87F5 Up: Map Next: 8857
8800: Move an object one frame: fall, climb, jump, walk
Used by the routine at MOVE_OR_RESPAWN.
The physics for everything. Nothing is solid but the map, and ants put themselves in the map (TOGGLE_MAP_BIT), so walking into an ant is walking into a wall -- and an ant arriving in someone's cell is a bite.
Input
IX The object
MOVE_OBJECT 8800 LD L,(IX+$00) Where it is.
8803 LD H,(IX+$01)
8806 LD C,(IX+$02)
8809 LD D,H Anything to stand on? If not, fall.
880A LD E,L
880B LD A,C
880C DEC A
880D CALL TEST_BELOW
8810 JP NC,FALL
This entry point is used by the routine at FALL.
MOVE_OBJECT_0 8813 LD D,H Something in this very cell: bitten, and pushed up.
8814 LD E,L
8815 LD A,C
8816 CALL TEST_MAP_BIT
8819 JP C,BITTEN
881C LD A,(IX+$06) Stunned: count it down.
881F AND A
8820 JP NZ,STUNNED
8823 LD A,(IX+$05) Just landed from a fall.
8826 CP $02
8828 JP NC,LANDED
882B XOR A Standing.
882C LD (IX+$05),A
882F BIT 1,(IX+$07) Jump.
8833 JP NZ,RISE
This entry point is used by the routines at FALL and RISE.
MOVE_OBJECT_1 8836 BIT 2,(IX+$07) Walk forward, if moving...
883A JP Z,MOVE_OBJECT_2
883D LD A,(IX+$04) ...a cell the way it faces...
8840 CALL STEP
8843 LD D,H
8844 LD E,L
8845 LD A,C
8846 CALL TEST_MAP_BIT
8849 JP C,STEP_UP ...unless the way is blocked.
884C LD (IX+$00),L A step.
884F LD (IX+$01),H
8852 LD (IX+$0F),$01
MOVE_OBJECT_2 8856 RET
Prev: 87F5 Up: Map Next: 8857