Routines
 Prev: 26276 Up: Map Next: 26336
26282: 'P' pressed - right
The address of this routine is found in the table of keypress handling routines at 26624. It is called from the main loop at 26471 when 'P' or '8' is pressed, and is also used by the routines at 25983 and 26084.
Input
B ERIC's animatory state
DE ERIC's coordinates
26282 CALL 25956 Is ERIC sitting or lying down?
26285 RET NZ Return if so
26286 CALL 26184 Check whether ERIC is on a staircase
26289 LD A,E A=ERIC's x-coordinate
26290 JR Z,26300 Jump if ERIC's not on a staircase
26292 CP 48 Is ERIC on a staircase at the right of the skool?
26294 JP NC,26084 Jump if so
26297 JP 25983
26300 BIT 7,B Is ERIC facing left?
26302 JP Z,25962 Turn ERIC round if so
ERIC is facing right, and is not on a staircase.
26305 CP 93 Is ERIC at the far right of the skool?
26307 RET Z Return if so
26308 LD A,D A=ERIC's y-coordinate
26309 CP 169 Is ERIC on the bottom floor?
26311 JR Z,26329 Jump if so
26313 CP 162 Is ERIC on the middle floor?
26315 JR NZ,26325 Jump if not
26317 LD A,E A=ERIC's x-coordinate
26318 CP 78 This is the x-coordinate of the far right wall on the middle floor
26320 RET Z Return if ERIC is facing this wall
26321 LD A,37 This is the x-coordinate of the wall between the White and Exam Rooms
26323 JR 26327
26325 LD A,56 This is the x-coordinate of the wall between the Reading and Map Rooms
26327 CP E Is ERIC facing this wall (from the left side)?
26328 RET Z Return if so (ERIC cannot walk through walls)
There is no wall obstructing ERIC, so it's time to put him midstride.
26329 LD A,129 129=ERIC midstride, facing right
26331 LD L,E L=ERIC's current x-coordinate
26332 INC E E=ERIC's post-midstride x-coordinate
26333 JP 26238 Put ERIC midstride
 Prev: 26276 Up: Map Next: 26336