Prev: D1D2 Up: Map Next: D21B
D1FF: BAT movement in tunnel section
bat movement in a tunnel
In the tunnels the bat appears with a high (downwards) speed and can reach high horizontal speeds as well. Bats are probably the main thing to avoid in tunnel sections.
They're designed to gravitate/slow down towards the centre point of the screen where Maroc is. It's possible for Maroc to suffer a heavy energy drain from bats during long tunnels. The CHALICE spell does not restore Maroc's energy during the tunnel segments.
D1FF LD A,($EB4D) Vertical movement speed (negative = up, positive = down)
D202 ADD A,$F6 This subtracts 10 from the bat's speed, initially moving downwards (speed values = positive) quickly, slowing its descent until it roughly reaches Maroc's vertical position.
It then starts moving back up the screen (speed values = negative) at an increasing speed.
D204 LD ($EB4D),A ...And re-store
D207 LD A,($EB48) Graphic's horizontal position, in half character (4 pixel) steps
D20A LD C,A
D20B LD A,$1C
D20D SUB C Subtract from 28
This is in 4-pixel/half-character steps, so it's around the centre of the screen.
At this point the value added to the bat's horizontal speed will reduce, meaning it stays around the centre of the screen for longer.
D20E ADD A,A x2
D20F ADD A,A x4
D210 LD C,A
D211 LD A,($EB4C) Horizontal movement speed (negative = left, positive = right)
D214 ADD A,C Add the calculated speed to this
D215 LD ($EB4C),A ...and re-store
D218 JP $D27D
Prev: D1D2 Up: Map Next: D21B