Prev: DA00 Up: Map Next: DAB7
DA7A: Update Player Legs
The routine for objects of type 10 to 15 and 18 to 1D, the legs of the player. While the player is materialising, the timer at MaterialiseTimer is advanced by two each frame and the player just flickers into view. Once the player is solid, it reads the controls and moves the player.
UpdatePlayerLegs DA7A RES 0,(IX+$07) Clear the flag for a collision.
DA7E LD HL,$BC02 Advance the timer for materialising by two.
DA81 LD A,(HL)
DA82 ADD A,$02
DA84 LD (HL),A
DA85 CP $4C Jump to UpdatePlayerLegs_Materialising if the player is still materialising.
DA87 JR C,UpdatePlayerLegs_Materialising
DA89 LD (HL),$70 Set the timer to the value for a solid player (70).
DA8B LD HL,$BBF5 Fetch the time that the speed bonus has left, and skip the next part if it is zero.
DA8E LD A,(HL)
DA8F AND A
DA90 JR Z,UpdatePlayerLegs_Controls
DA92 DEC (HL) Count down the time, and skip the next part if there is some left.
DA93 JR NZ,UpdatePlayerLegs_Controls
DA95 LD A,$0A Set the maximum speed back to the normal 0A.
DA97 LD ($BBBE),A
DA9A LD (IX+$05),$08 Set the speed of the player to 08.
UpdatePlayerLegs_Controls DA9E CALL ReadControls Read the controls.
DAA1 LD E,C Keep the controls in E.
DAA2 CALL CheckRotateKey Check whether the key to turn the view has been pressed.
DAA5 CALL ChooseDirection Work out the direction that the player is facing.
DAA8 PUSH DE Keep the controls.
DAA9 CALL MovePlayer Move the player.
DAAC POP DE Restore the controls from the stack.
DAAD CALL ThrowItem Throw an item if the fire button was pressed.
DAB0 RET Return.
The player is materialising.
UpdatePlayerLegs_Materialising DAB1 CALL SetFacingFlags Set the sprite of the player.
DAB4 JP PlayMaterialiseSound Play the sound for materialising.
Prev: DA00 Up: Map Next: DAB7