Prev: 55277 Up: Map Next: 55367
55308: Update Thrown Item
The routine for objects of type 8 to 11, the items that the player has thrown. The item flies in a straight line. If it hits the object that is four places along the object table (the monster that it belongs to), the monster is destroyed, 37 hundred points are added to the score and the monster explodes into fragments. If the item hits something else, it lands and becomes an item that can be picked up again (type 4 to 7).
UpdateThrownItem 55308 LD A,(IX+5) Set the velocity of the item from its speed and direction.
55311 CALL SetVelocityFromSpeed
55314 CALL TestMove Check whether the scenery blocks the move along one axis.
55317 CALL MoveObject Move the item.
55320 CALL TestMove_Keep Check whether the scenery blocks the move along the other axis.
55323 CALL MoveObject Move the item.
55326 CALL CheckOverlapWithNextObject Check whether the item has hit its monster, and jump to UpdateThrownItem_Hit if it has.
55329 JR C,UpdateThrownItem_Hit
55331 BIT 0,(IX+7) Return if the item has not hit the scenery.
55335 RET Z
55336 LD A,(IX+0) Change the type of the item to the one for an item that is lying on the ground, and return.
55339 AND 3
55341 OR 4
55343 LD (IX+0),A
55346 RET
The item has hit its monster.
UpdateThrownItem_Hit 55347 LD (IY+0),132 Change the monster into a flash (type 132).
55351 LD (IX+0),12 Turn the item into a burst.
55355 LD BC,9472 Add 37 hundred points to the score.
55358 CALL AddToScore
55361 CALL CreateFragments Create fragments from the monster.
55364 JP DrawMonsterIcons Jump to DrawMonsterIcons.
Prev: 55277 Up: Map Next: 55367