Prev: 43998 Up: Map Next: 44046
44015: Set Tribesman Velocity
Used by the routine at HandlerTribesman.
Sets the X velocity of a tribesman and makes it face the way it is going, then chooses a random Y velocity.
Input
A The X velocity
BC Address of the table of velocities at TribesmanVelocities
IX Actor record of the tribesman
SetTribesmanVelocity 44015 LD (IX+6),A Set the X velocity of the tribesman.
44018 AND A Jump to SetTribesmanVelocity_Left if the tribesman is moving left.
44019 JP M,SetTribesmanVelocity_Left
44022 SET 2,(IX+0) Set bit 2 of the sprite ID so that the tribesman faces right.
SetTribesmanVelocity_Y 44026 LD A,(23672) Fetch the low byte of FRAMES.
44029 AND %00000011 Keep only bits 0-1.
44031 LD L,A Stash the velocity index in L.
44032 LD H,0 Clear H.
44034 ADD HL,BC Add the table address to get the address of the velocity.
44035 LD A,(HL) Fetch the Y velocity from the table.
44036 LD (IX+7),A Set the Y velocity of the tribesman.
44039 RET Return.
The tribesman is moving left.
SetTribesmanVelocity_Left 44040 RES 2,(IX+0) Reset bit 2 of the sprite ID so that the tribesman faces left.
44044 JR SetTribesmanVelocity_Y Jump to SetTribesmanVelocity_Y.
Prev: 43998 Up: Map Next: 44046