Prev: 8C58 Up: Map Next: 8CB1
8C67: Turn an object towards the view
Used by the routine at start_at_edge.
Fallen into from steer_to_view, and jumped to by start_at_edge for a new attacker. Stops the object and sets its acceleration: $20 (an eighth of a pixel a pass, each pass) to the right if it is in the view's own screen column, otherwise to the left; down if it is in the view's screen row above the view's top line; up if it is in another screen row below that line; otherwise none in Y. (The view is one screen in size, so it covers the part of its own screen from that line down and the part of the screen below above it.)
head_for_view 8C67 LD (IX+$0B),$00 Accelerate right in the view's column, left in the next
8C6B LD (IX+$0C),$20
8C6F LD A,(view_column)
8C72 CP (IX+$01)
8C75 JR Z,head_for_view_0
8C77 LD (IX+$0C),$E0
8C7B LD (IX+$0B),$FF
head_for_view_0 8C7F XOR A Stop it
8C80 LD (IX+$09),A
8C83 LD (IX+$0A),A
8C86 LD (IX+$0E),A
8C89 LD (IX+$0F),A
8C8C LD A,(view_row) Its screen row against the view's
8C8F CP (IX+$04)
8C92 LD A,(view_y)
8C95 JR NZ,head_for_view_1
8C97 CP (IX+$05) The view's row, above the view: down
8C9A RET C
8C9B LD (IX+$0E),$00
8C9F LD (IX+$0F),$20
8CA3 RET
head_for_view_1 8CA4 CP (IX+$05) The row below, beneath the view: up
8CA7 RET NC
8CA8 LD (IX+$0E),$FF
8CAC LD (IX+$0F),$E0
8CB0 RET
Prev: 8C58 Up: Map Next: 8CB1