Prev: 38540 Up: Map Next: 38592
38554: Script routine: (60) Check position of ape-beast and turn if appropriate
Used by the routine at 48096.
Input
IX Address of complex state data for an entity
Output
HL New address in script data
38554 BIT 0,(IX+11) If ape-beast's walking-right flag is set...
38558 JR NZ,38575 ...then skip ahead to 38575
Ape-beast walking left
38560 LD A,(IX+12) If minimum allowed x-coordinate of ape-beast...
38563 CP (IX+5) ...is less than x-coordinate of left edge of ape-beast...
38566 JP C,48096 ...then jump to 48096 (advance HL to next script instruction and execute)
38569 LD HL,38432 Point HL at script data for ape-beast walking right...
38572 JP 48098 ...and execute
Ape-beast walking right
38575 LD A,(IX+12) If minimum allowed x-coordinate of ape-beast...
38578 ADD A,13 ...plus 13...
38580 CP (IX+7) ...is equal to or greater than x-coordinate of right edge of ape-beast...
38583 JP NC,48096 ...then jump to 48096 (advance HL to next script instruction and execute)
38586 LD HL,38450 Point HL at script data for ape-beast walking left...
38589 JP 48098 ...and execute
Prev: 38540 Up: Map Next: 38592