Routines |
Prev: D019 | Up: Map | Next: D065 |
Check if a creature has collided with a room boundary or Maroc:
|
||||
D04B | LD A,($EC9C) | FREEZE spell timer counter (> 0 means the FREEZE spell is in effect) | ||
D04E | CP $00 | |||
D050 | JR NZ,$D090 | Maroc doesn't lose energy if he touches stationary creatures when the FREEZE spell is in effect | ||
Check creature is within room wall boundary, adjusting if needed:
|
||||
D052 | LD A,($EB4A) | Creature's vertical pixel position in room | ||
D055 | ADD A,$08 | Adjust the vertical point to check for collisions 8 pixels down, towards the middle of the creature, rather than the top | ||
D057 | LD E,A | Store in E register, which is what the room boundary is checked against | ||
D058 | CALL $E039 | Run room boundary checks for creature, adjusting position accordingly if needed | ||
Check collision detection with Maroc
|
||||
D05B | LD C,$00 | Collision event type 0 = collision with Maroc | ||
D05D | CALL $DFCD | Run collision check | ||
D060 | CP $00 | The A register is returned with 1 = collision, or 0 = no collision | ||
D062 | JP Z,$D27D | If no collision, can jump out of the entire routine here | ||
The next routine follows if a creature has collided with Maroc
|
Prev: D019 | Up: Map | Next: D065 |