Routines |
Prev: D6D2 | Up: Map | Next: D730 |
Used by the routine at D6D2.
|
||||
Jump from D6E0 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.
|
||||
D71C | LD A,($EAAA) | Get the game timer | ||
D71F | INC A | Increment it | ||
D720 | AND $07 | Check bits 0-2 (values 0-7) | ||
D722 | JR NZ,$D794 | |||
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.
|
||||
D724 | CALL $DB06 | Generate pseudo-random number in A register | ||
D727 | LD C,A | Store in C register | ||
D728 | LD A,($EAB7) | Get room number | ||
D72B | SUB $30 | Because tunnels are rooms 224-255, this will result in a value somewhere in the 176-207 range | ||
D72D | CP C | Is this value greater than the random number? | ||
D72E | JR NC,$D794 | If so, jump out of here If not, continue to the next routine to generate a SPIDER or a BAT |
Prev: D6D2 | Up: Map | Next: D730 |