![]() |
Routines |
| Prev: 9ABC | Up: Map | Next: 9AF9 |
|
Used by the routine at SpawnFlame.
Chooses a position for a new flame. Depending on bit 0 of the counter at GameTimer the flame is either placed in the same column as the player (with a position from the frame counter for its row, see ChoosePosition_SetY) or in the same row as the player (see PlaceFlame_InRow). It then finishes by checking the position, see ChoosePosition_Test.
|
||||||||||||
| PlaceFlame | 9AE9 | LD A,($9693) | Fetch the low byte of the game timer from GameTimer. | |||||||||
| 9AEC | AND %00000001 | Keep only bit 0. | ||||||||||
| 9AEE | JR NZ,PlaceFlame_InRow | Jump to PlaceFlame_InRow if the flame is to appear in the same row as the player. | ||||||||||
|
Use the same X position as the player.
|
||||||||||||
| 9AF0 | LD A,($9705) | Fetch the X position of the player from 9705. | ||||||||||
| 9AF3 | LD (IX+$03),A | Set the X position of the flame. | ||||||||||
| 9AF6 | LD E,A | Copy the X position to E. | ||||||||||
| 9AF7 | JR ChoosePosition_SetY | Jump to ChoosePosition_SetY to choose the Y position. | ||||||||||
| Prev: 9ABC | Up: Map | Next: 9AF9 |