Prev: 9837 Up: Map Next: 986A
984D: Accelerate Randomly
Behaviour code used for objects of type 18 and 1A (see RunObjectBehaviour). Gives the object a random acceleration.
Input
IX Address of the object
AccelerateRandomly 984D LD A,($9BCB) Fetch the first byte of the random seed.
9850 AND %00000001 Keep bit 0.
9852 CALL ChooseAcceleration Choose a horizontal acceleration.
9855 LD (IX+$0B),D Set the horizontal acceleration of the object.
9858 LD (IX+$0C),E
985B LD A,($9BCB) Fetch the first byte of the random seed.
985E AND %00000010 Keep bit 1.
9860 CALL ChooseAcceleration Choose a vertical acceleration.
9863 LD (IX+$0E),D Set the vertical acceleration of the object.
9866 LD (IX+$0F),E
9869 RET Return.
Prev: 9837 Up: Map Next: 986A