Prev: 49670 Up: Map Next: 49797
49764: Score For Creature
Used by the routine at RunProjectile.
Adds the points for a creature that has been hit by a projectile to the score, makes the creature explode, and makes the projectile disappear. The points are worked out from the type of the creature, by rotating its bits and keeping the ones that make up the digits, each of which is from 0 to 7.
Input
IX Record of the projectile
IY Record of the creature
Work out the points from the type of the creature.
ScoreForCreature 49764 LD A,(IY+0) Fetch the type of the creature, and stash it in B.
49767 LD B,A
49768 RLCA Rotate it left twice.
49769 RLCA
49770 AND %01110111 Keep only the bits that make the lower two digits.
49772 LD C,A Set the lower two digits of the points in C.
49773 LD A,B Fetch the type of the creature again.
49774 RLCA Rotate it left three times.
49775 RLCA
49776 RLCA
49777 AND %00000111 Keep only the bits that make the upper two digits.
49779 LD B,A Set the upper two digits of the points in B.
Add the points and explode both objects.
49780 CALL AddToScore Call AddToScore to add the points to the score.
49783 CALL CopyScoreToScreen Call CopyScoreToScreen to copy the score to the screen.
49786 LD (IY+0),64 Change the creature to the first stage of an explosion.
49790 SET 1,(IY+7) Flag the creature as being moved, so that nothing can push it.
49794 JP FinishExplosion_Erase Jump to FinishExplosion_Erase to change the projectile into the marker that makes it be erased.
Prev: 49670 Up: Map Next: 49797