Prev: ADBF Up: Map Next: AE34
ADD0: Player Movement
PlayerMovement ADD0 CALL StoreEntity Call StoreEntity.
ADD3 CALL $A18C Call A18C.
ADD6 LD A,$10 Write 10 to 96AD.
ADD8 LD ($96AD),A
ADDB LD A,(IX+$02)
ADDE AND A
ADDF JP NZ,$A985
Initialise the player movement (0000 == no movement).
ADE2 LD DE,$0000 DE=0000.
ADE5 CALL HandlerControls Call HandlerControls.
Check if the player is under the influence of an orchid.
ADE8 LD A,(IX+$05) A=the colour of the player.
ADEB CP $47 If the player is not using attribute 47 (white) then jump to AE34.
ADED JR NZ,$AE34
Controllers for player controls.
Handle "fire".
ADEF BIT 4,C Jump to AE34 if "fire" was pressed.
ADF1 JR Z,$AE34
Handle "right".
ADF3 BIT 1,C Jump to PlayerMovement_Left if "right" was pressed.
ADF5 JR Z,PlayerMovement_Left
Update movement for moving right.
ADF7 LD A,E E=E+20.
ADF8 ADD A,$20
ADFA LD E,A
Handle "left".
PlayerMovement_Left ADFB BIT 0,C Jump to PlayerMovement_Down if "left" was pressed.
ADFD JR Z,PlayerMovement_Down
Update movement for moving left.
ADFF LD A,E E=E-20.
AE00 SUB $20
AE02 LD E,A
Handle "down".
PlayerMovement_Down AE03 BIT 2,C Jump to PlayerMovement_Up if "down" was pressed.
AE05 JR Z,PlayerMovement_Up
Update movement for moving down.
AE07 LD A,D D=D-20.
AE08 SUB $20
AE0A LD D,A
Handle "up".
PlayerMovement_Up AE0B BIT 3,C Jump to PlayerMovement_0 if "up" was pressed.
AE0D JR Z,PlayerMovement_0
Update movement for moving up.
AE0F LD A,D D=D+20.
AE10 ADD A,$20
AE12 LD D,A
Update the player Actor Entity.
PlayerMovement_0 AE13 LD (IX+$06),E Write E to IX+06.
AE16 LD (IX+$07),D Write D to IX+07.
AE19 CALL $AFE8 Call AFE8.
AE1C LD BC,$160E BC=160E.
AE1F CALL $B81C Call B81C.
AE22 CALL $AE4B Call AE4B.
AE25 CALL $AAED Call AAED.
AE28 LD (IX+$03),E Write E to IX+03 (sprite x co-ordinate).
AE2B LD (IX+$04),D Write D to IX+04 (sprite y co-ordinate).
AE2E CALL NZ,$BF4B
AE31 JP $AD5D Jump to AD5D.
Prev: ADBF Up: Map Next: AE34