Prev: CF22 Up: Map Next: CF9E
CF68: Run Collectable Object
The handler of the object types 70 to 77, which are the four objects that are the aim of the quest, and the same four once they have been collected. An object is collected by the helper, RunHelper, which sets bit 0 of the handler flags at 16.
When that has happened, the player is given an extra life, and the object changes to the type that is 04 higher, in the object store as well. When all four have been collected, CheckObjectsCollected reveals the pentagram.
Input
IX Object record
Return unless the helper has collected the object.
RunCollectableObject CF68 CALL SetSpriteOffset_Minus16_Minus8 Call SetSpriteOffset_Minus16_Minus8 to set the offsets of the sprite.
CF6B CALL ApplyGravityAndMove_Move Call ApplyGravityAndMove_Move to move the object, without gravity.
CF6E BIT 0,(IX+$16) Return if the object has not been collected.
CF72 RET Z
Give a life and change the object to the collected type.
CF73 LD A,($A74C) Add one to the count of objects collected.
CF76 INC A
CF77 LD ($A74C),A
CF7A LD A,($A721) Add one to the number of lives.
CF7D INC A
CF7E LD ($A721),A
CF81 PUSH IX Save IX.
CF83 CALL DrawLives Call DrawLives to draw the lives.
CF86 POP IX Get IX back.
CF88 RES 0,(IX+$16) Clear the flag for the object having been collected.
CF8C LD A,(IX+$00) Set the new type, which is 04 more than the old, in C.
CF8F ADD A,$04
CF91 LD C,A
CF92 LD A,(IX+$00) Fetch the old type of the object.
CF95 CALL ChangeObjectType Call ChangeObjectType to change the type of the object, and that of its entry in the object store.
CF98 CALL CheckObjectsCollected Call CheckObjectsCollected to find out if all of the objects have been collected.
CF9B JP SetWipeAndDrawFlags Jump to SetWipeAndDrawFlags to flag the object as moved.
Prev: CF22 Up: Map Next: CF9E