![]() |
Routines |
| Prev: 27871 | Up: Map | Next: 28062 |
|
Used by the routine at Handle_Butterfly.
Generates a valid random position for the butterfly by repeatedly generating coordinates until one passes the boundary check.
|
||||
| Randomise_Butterfly_Position | 28048 | CALL GenerateRandomNumber | Call GenerateRandomNumber. | |
| 28051 | LD C,A | Copy to C (X position). | ||
| 28052 | CALL GenerateRandomNumber | Call GenerateRandomNumber. | ||
| 28055 | LD B,A | Copy to B (Y position). | ||
| 28056 | CALL Validate_Position | Call Validate_Position to validate the position. | ||
| 28059 | JR C,Randomise_Butterfly_Position | Jump back to Randomise_Butterfly_Position if the position is invalid (carry set). | ||
| 28061 | RET | Return. | ||
| Prev: 27871 | Up: Map | Next: 28062 |