Prev: 42057 Up: Map Next: 42110
42066: Handle Sheriff Entrance
Type 26: the sheriff arriving back in the street. The vertical offset of the sprite in byte 13 grows by four every frame, with a rising sound, until it reaches 28. The object then becomes a sheriff (type 1) and is protected from harm for a short time.
Raise the sprite and play a rising tone.
HandleSheriffEntrance 42066 LD A,(IX+13) Fetch the vertical offset of the sprite.
42069 ADD A,4 Add 4 to the offset.
42071 LD (IX+13),A Store the new offset.
42074 CALL PlayShortTone Play a sound effect whose pitch depends on the offset.
42077 LD A,(IX+13) Fetch the offset again.
42080 CP 28 Return if the offset is still below 28.
42082 RET C
The sheriff has arrived, so turn the object into a sheriff.
42083 LD (IX+0),1 Turn the object into a sheriff.
42087 LD (IX+13),0 Reset the vertical offset of the sprite to zero.
42091 LD A,16 Write 16 to ProtectionTimer to make the sheriff invulnerable for a short time.
42093 LD (41480),A
42096 LD HL,41512 Point the sprite list of the object at SheriffSpriteList.
42099 LD (IX+14),L
42102 LD (IX+15),H
42105 LD C,0 Clear C, so that no controls are being pressed.
42107 JP HandleSheriff_Act Carry on in the sheriff handler.
Prev: 42057 Up: Map Next: 42110