Prev: BF95 Up: Map Next: C02C
BFF1: The update routine for the creature (graphics 136-139)
It makes for the knight, two units a turn along U and along V (STEER_AT_KNIGHT), blipping while on the screen (BLIP_BY_TURN). A wall stops it dead: it bursts, for 1000 points -- the reward for leading it into one. More than two cells from the knight in column or row, it is left behind: the record is emptied. An antibody strikes it for 1000, both bursting (but only the first antibody record can, ANTIBODY_STRIKE); touching the knight, it bursts and takes one of his hits (WANDERING_MONSTER).
Input
IX the creature's record
CREATURE_UPDATE BFF1 CALL BLIP_BY_TURN the blip, if it was drawn last turn
BFF4 CALL STEER_AT_KNIGHT steps of two towards the knight
BFF7 CALL MOVE_SPLIT is the way clear, along U and then V? (MOVE_SPLIT)
BFFA BIT 0,(IX+$07) a wall: it bursts, for 1000
BFFE JR NZ,CREATURE_UPDATE_2
C000 CALL APPLY_STEP move by the steps
C003 CALL NEXT_FRAME_MOD4 the next frame of the four
C006 LD C,$03 three cells or more from him: left behind
C008 CALL NEAR_KNIGHT
C00B JR NC,CREATURE_UPDATE_0
C00D CALL ANTIBODY_STRIKE struck by an antibody?
C010 JR C,CREATURE_UPDATE_1
C012 CALL TOUCHING_KNIGHT touching him: it bursts, and he loses a hit
C015 RET NC
C016 JP MONSTER_HITS_KNIGHT
CREATURE_UPDATE_0 C019 LD (IX+$00),$00 left behind: the record emptied (never ran in the sessions)
C01D RET
CREATURE_UPDATE_1 C01E LD (IY+$00),$0C the antibody bursts...
CREATURE_UPDATE_2 C022 LD (IX+$00),$0C ...and so does the creature
C026 LD BC,$0010 1000
C029 JP ADD_SCORE
Prev: BF95 Up: Map Next: C02C