Prev: 26254 Up: Map Next: 26327
26278: Update Blooming Flower
Opens the flower once the "get ready" delay has finished. Every eighth update the flower moves on to the next stage, using the sprite for the stage from FlowerSpriteTable. At stage 4 the flower is coloured in using ColouriseFlower, and at stage 5 the level is complete (LevelComplete).
Stage 0 Stage 1 Stage 2 Stage 3 Stage 4
bloom-stage-0 bloom-stage-1 bloom-stage-2 bloom-stage-3 bloom-stage-4
Input
IX Flower object
UpdateBloomingFlower 26278 CALL StoreEntity Remember the position and state using StoreEntity.
26281 LD A,(24098) Return if the "get ready" delay in PlayDelay_Counter is not finished.
26284 AND A
26285 JR NZ,UpdateBloomingFlower_Return
26287 LD A,(24087) A=the game timer from GameTimer.
26290 AND %00000111 Keep only bits 0-2 (so that the flower only changes stage every eighth update).
26292 JR NZ,UpdateBloomingFlower_Return Return if it is not time for the next stage.
26294 CALL GetFlowerSprite Get the sprite for the current stage using GetFlowerSprite.
26297 CALL SetUpPreviousSprite_Address Set up the previous sprite using SetUpPreviousSprite_Address.
26300 EXX Switch to the shadow registers.
26301 INC (IX+4) Increment the stage in IX+4 by one.
26304 LD A,(IX+4) A=the stage.
26307 CP 4 Compare the stage with 4 (the open flower).
26309 CALL Z,ColouriseFlower Call ColouriseFlower if this is stage 4 to colour the flower in.
26312 CP 5 Jump to LevelComplete if the stage is 5 (note that A has been overwritten if the flower was just coloured).
26314 JR Z,LevelComplete
26316 CALL GetFlowerSprite Get the sprite for the new stage using GetFlowerSprite.
26319 CALL SetUpSprite_Address Set up the new sprite using SetUpSprite_Address.
26322 EXX Switch to the shadow registers.
26323 CALL DisplayEntity_Compare Draw the new sprite and erase the previous one using DisplayEntity_Compare.
UpdateBloomingFlower_Return 26326 RET Return.
Prev: 26254 Up: Map Next: 26327