Prev: A449 Up: Map Next: A47E
A452: Handle Sheriff Entrance
Type 1A: the sheriff arriving back in the street. The vertical offset of the sprite in byte 0D grows by four every frame, with a rising sound, until it reaches 1C. The object then becomes a sheriff (type 01) and is protected from harm for a short time.
Raise the sprite and play a rising tone.
HandleSheriffEntrance A452 LD A,(IX+$0D) Fetch the vertical offset of the sprite.
A455 ADD A,$04 Add 04 to the offset.
A457 LD (IX+$0D),A Store the new offset.
A45A CALL PlayShortTone Play a sound effect whose pitch depends on the offset.
A45D LD A,(IX+$0D) Fetch the offset again.
A460 CP $1C Return if the offset is still below 1C.
A462 RET C
The sheriff has arrived, so turn the object into a sheriff.
A463 LD (IX+$00),$01 Turn the object into a sheriff.
A467 LD (IX+$0D),$00 Reset the vertical offset of the sprite to zero.
A46B LD A,$10 Write 10 to ProtectionTimer to make the sheriff invulnerable for a short time.
A46D LD ($A208),A
A470 LD HL,$A228 Point the sprite list of the object at SheriffSpriteList.
A473 LD (IX+$0E),L
A476 LD (IX+$0F),H
A479 LD C,$00 Clear C, so that no controls are being pressed.
A47B JP HandleSheriff_Act Carry on in the sheriff handler.
Prev: A449 Up: Map Next: A47E