Prev: D70A Up: Map Next: D74C
D727: The update routine for the bonus of graphic 2: a faster walk
A bonus lies only while the knight is within three cells of it, in both directions; further away it is gone, and PLACE_BONUS will place another. Touched, it gives him a top speed of 18 for 255 of his turns (SPEED_TIME, counted down by UPDATE_KNIGHT) and sound effect 1 for five turns.
Input
IX The bonus's record (BONUS)
SPEED_BONUS D727 LD C,$04 Is the knight within three cells of it (fewer than four columns and four rows away)?
D729 CALL NEAR_KNIGHT
D72C JR C,SPEED_BONUS_0
D72E LD (IX+$00),$00 No: the bonus is gone, without a trace
D732 RET
SPEED_BONUS_0 D733 CALL TOUCHING_KNIGHT Yes: done unless he is touching it
D736 RET NC
D737 LD (IX+$00),$0C Touched: it vanishes (VANISHING)
D73B LD A,$FF The faster walk lasts 255 turns
D73D LD (SPEED_TIME),A
D740 LD A,$12 Top speed 18 instead of 10
D742 LD (TOP_SPEED),A
D745 LD HL,$0105 Sound effect 1, for five turns
D748 LD (EFFECT_TIME),HL
D74B RET
Prev: D70A Up: Map Next: D74C