Routines |
Prev: 54994 | Up: Map | Next: 55088 |
Used by the routine at 54994.
|
||||
Jump from 55008 if no new tunnel wall has been generated during this particular game cycle.
Every 8 game cycles, there's a chance of a creature appearing.
|
||||
55068 | LD A,(60074) | Get the game timer | ||
55071 | INC A | Increment it | ||
55072 | AND 7 | Check bits 0-2 (values 0-7) | ||
55074 | JR NZ,55188 | |||
Executed after 8 game timer cycles. Combined with a pseudo-random number, this affects the likelihood interval of a creature (spider/bat) appearing in the tunnel.
|
||||
55076 | CALL 56070 | Generate pseudo-random number in A register | ||
55079 | LD C,A | Store in C register | ||
55080 | LD A,(60087) | Get room number | ||
55083 | SUB 48 | Because tunnels are rooms 224-255, this will result in a value somewhere in the 176-207 range | ||
55085 | CP C | Is this value greater than the random number? | ||
55086 | JR NC,55188 | If so, jump out of here If not, continue to the next routine to generate a SPIDER or a BAT |
Prev: 54994 | Up: Map | Next: 55088 |