Prev: 39243 Up: Map Next: 39284
39259: Run Type 19 Behaviour
Behaviour code for objects of type 25 (see RunObjectBehaviour). Gives the object a random lifetime and, with a small chance, chases the player.
Input
IX Address of the object
RunType19Behaviour 39259 LD A,(39883) Fetch the second byte of the random seed.
39262 AND %00111111 Keep six bits.
39264 ADD A,16 Add 16.
39266 LD (IX+21),A Set the lifetime of the object.
39269 LD A,R Fetch a pseudo-random value from the refresh register.
39271 AND %00000011 Keep two bits.
39273 JP Z,ClearObjectSpeeds Jump to ClearObjectSpeeds if they are zero.
39276 CALL ChasePlayer Chase the player.
39279 RES 7,(IX+22) Clear bit 7 of the third state byte of the object.
39283 RET Return.
Prev: 39243 Up: Map Next: 39284