Prev: CAC2 Up: Map Next: CAEA
CAC6: Handle Bullet
Type 02: a bullet fired by the sheriff in the town. It moves twice, checking the walls each time. If it hits a wall it becomes type 07.
Input
IX The address of the object
Move the bullet in two steps.
HandleBullet CAC6 LD A,(IX+$05) Fetch the speed.
CAC9 CALL SetSpeedsFromHeading Call SetSpeedsFromHeading.
CACC CALL TestMove Call TestMove.
CACF CALL MoveObject Call MoveObject.
CAD2 CALL CheckWalls Call CheckWalls.
CAD5 CALL MoveObject Call MoveObject.
Turn into smoke if it has hit a wall.
CAD8 RES 1,(IX+$07) Clear bit 1 of the flags.
CADC BIT 0,(IX+$07) Return if it has not hit a wall.
CAE0 RET Z
CAE1 LD (IX+$00),$07 Turn the object into type 07.
CAE5 LD (IX+$0C),$02 Set the counter to 02 and return.
CAE9 RET
Prev: CAC2 Up: Map Next: CAEA