Prev: E3A4 Up: Map Next: E3E0
E3C2: Controller: Is There A Bomb?
Used by the routine at Handler_Items.
Input
BC Position coordinates for where to place the bomb
Controller_BombCheck E3C2 CALL GetRandomNumber Call GetRandomNumber.
E3C5 CP $40 Return if the random number is higher than 40.
E3C7 RET NC
E3C8 LD A,($E479) Return if *TableBomb_Flag indicates a bomb already exists on the screen - we can only process one at-a-time.
E3CB CP $00
E3CD RET NZ
We're good to create a bomb!
E3CE LD A,$20 Set the base sprite (20) to *TableBomb_SpriteID.
E3D0 LD ($E475),A
E3D3 LD ($E46F),BC Write the coordinates (BC) to *TableBomb_Position for where it should appear.
Initialise the bomb, and the sound for it.
E3D7 LD A,$01 Write 01 to:
E3D9 LD ($E479),A
E3DC LD ($FFFD),A
E3DF RET Return.
Prev: E3A4 Up: Map Next: E3E0