Prev: 708E Up: Map Next: 7113
7104: Ship or helicopter operation routine
Animates and moves ships and helicopters. On even ticks, advances the object by 2 pixels toward the opposite river bank. When the object gets within 16 pixels of the bank edge, it reverses direction.
  • Checks tick parity for movement timing
  • Determines direction from bit 6 (SLOT_BIT_ORIENTATION)
  • Left-facing objects advance left, right-facing advance right
  • Collision with terrain triggers direction reversal
Input
B Y position of object
C X position of object
D Object definition byte
operate_ship_or_helicopter 7104 LD A,($5EEF) Skip if odd tick (ships/helicopters move on even ticks).
7107 AND $01
7109 CP $00
710B JP Z,animate_object
710E BIT 6,D Check orientation: if bit 6 clear (right-facing), jump to ship_or_helicopter_right_advance.
7110 JP Z,ship_or_helicopter_right_advance
Prev: 708E Up: Map Next: 7113