Prev: 871A Up: Map Next: 8787
875F: Pop Creature
Turns a creature into a pop, which is what happens when it is hit by a weapon or when it touches the player. The creature is removed from the screen and redrawn as the first frame of the pop with the room attribute under it (see HandlerPop), and the player is given 0155 points.
Input
IX The creature entity
PopCreature 875F LD A,(IX+$05) Fetch the attribute of the creature.
8762 PUSH AF Stash it on the stack.
8763 LD A,($5E1A) Fetch the room attribute from CurrentRoom_Attribute.
8766 LD (IX+$05),A Update the attribute of the creature.
8769 CALL RemoveEntity Call RemoveEntity to remove the creature from the screen.
876C CALL SetEntityAttributes_Moved Call SetEntityAttributes_Moved to set the attributes of the cells that the creature covered.
876F POP AF Restore the attribute of the creature from the stack.
8770 LD (IX+$05),A Write it to the attribute of the creature.
8773 LD (IX+$00),$6C Write 6C to the sprite ID of the creature (the first frame of the pop).
8777 LD (IX+$0E),$10 Set the counter at offset 0E to 10.
877B LD BC,$0155 BC=0155 (the points to add to the score).
877E CALL AddPointsToScore Call AddPointsToScore to add the points to the score.
8781 CALL DrawEntity Call DrawEntity to draw the pop.
8784 JP SetEntityAttributes_Moved Jump to SetEntityAttributes_Moved to set the attributes.
Prev: 871A Up: Map Next: 8787