Prev: 51954 Up: Map Next: 52029
51960: Move Drutt closer to the worm and eat it if close enough
Used by the routine at 51779.
Input
IX Address of complex state data (current level) for Drutt
IY Address of complex state data (current level) for worm
51960 LD A,(IY+0) If Drutt and worm are not in the same room...
51963 CP (IX+0) ...
51966 JP NZ,51864 ...then move Drutt closer to worm if appropriate, otherwise make Drutt perform random action
51969 LD A,(IX+5) If Drutt's left edge...
51972 CP (IY+5) ...is to the left of the worm's...
51975 JR C,52017 ...then skip ahead to 52017
51977 LD A,(IY+7) If worm's right edge...
51980 CP (IX+5) ...is to the left of Drutt's left edge...
51983 JR C,52023 ...then skip ahead to 52023
51985 LD A,(IX+4) If y-coordinate of Drutt's top edge...
51988 CP 120 ...is less than 120...
51990 JP C,51875 ...then randomly select an action for Drutt and execute
51993 LD A,(IY+1) If worm's depth is the same as Drutt's...
51996 CP (IX+1) ...
51999 JR Z,52007 ...then skip ahead to 52007
Drutt and worm in same room, at different depth and same x-coordinate
52001 LD HL,51630 Point HL at script data for Drutt swapping depth levels...
52004 JP 48098 ...and execute
Drutt and worm in same room, at same depth and same x-coordinate
52007 LD (IY+1),0 Set worm's depth to zero (i.e. remove from play)
52011 LD HL,51706 Point HL at script data for Drutt eating a worm...
52014 JP 48098 ...and execute
Drutt's left edge to left of worm's
52017 LD HL,51538 Point HL at script data for moving Drutt and any pushed entity right by a hop of size four...
52020 JP 48098 ...and execute
Worm's right edge to left of Drutt's left edge
52023 LD HL,51584 Point HL at script data for moving Drutt and any pushed entity left by a hop of size four...
52026 JP 48098 ...and execute
Prev: 51954 Up: Map Next: 52029