Prev: B3EA Up: Map Next: B403
B3F2: Choose Random Colour
Used by the routine at UpdateShot.
Picks one of four attributes for an object at random and stores it at offset 0D.
Input
IX Address of the object
ChooseRandomColour B3F2 LD A,($9BCB) The random numbers.
B3F5 AND %00000011 Keep the bits of A that are set in 03.
B3F7 ADD A,$45 Add 45 to A.
B3F9 CP $48 Jump to ChooseRandomColour_Store if A is not 48.
B3FB JR NZ,ChooseRandomColour_Store
B3FD LD A,$43 A=43.
ChooseRandomColour_Store B3FF LD (IX+$0D),A Write A to offset 0D of IX.
B402 RET Return.
Prev: B3EA Up: Map Next: B403