Prev: C206 Up: Map Next: C285
C264: 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 C264 LD A,(IY+$00) Fetch the type of the creature, and stash it in B.
C267 LD B,A
C268 RLCA Rotate it left twice.
C269 RLCA
C26A AND %01110111 Keep only the bits that make the lower two digits.
C26C LD C,A Set the lower two digits of the points in C.
C26D LD A,B Fetch the type of the creature again.
C26E RLCA Rotate it left three times.
C26F RLCA
C270 RLCA
C271 AND %00000111 Keep only the bits that make the upper two digits.
C273 LD B,A Set the upper two digits of the points in B.
Add the points and explode both objects.
C274 CALL AddToScore Call AddToScore to add the points to the score.
C277 CALL CopyScoreToScreen Call CopyScoreToScreen to copy the score to the screen.
C27A LD (IY+$00),$40 Change the creature to the first stage of an explosion.
C27E SET 1,(IY+$07) Flag the creature as being moved, so that nothing can push it.
C282 JP FinishExplosion_Erase Jump to FinishExplosion_Erase to change the projectile into the marker that makes it be erased.
Prev: C206 Up: Map Next: C285