QueueFollowerFirstStep:: call .QueueFirstStep jr c, .same ld [wFollowMovementQueue], a xor a ld [wFollowerMovementQueueLength], a ret .same ld a, -1 ld [wFollowerMovementQueueLength], a ret .QueueFirstStep: ld a, [wObjectFollow_Leader] call GetObjectStruct ld hl, OBJECT_MAP_X add hl, bc ld d, [hl] ld hl, OBJECT_MAP_Y add hl, bc ld e, [hl] ld a, [wObjectFollow_Follower] call GetObjectStruct ld hl, OBJECT_MAP_X add hl, bc ld a, d cp [hl] jr z, .check_y jr c, .left and a ld a, movement_step + RIGHT ret .left and a ld a, movement_step + LEFT ret .check_y ld hl, OBJECT_MAP_Y add hl, bc ld a, e cp [hl] jr z, .same_xy jr c, .up and a ld a, movement_step + DOWN ret .up and a ld a, movement_step + UP ret .same_xy scf ret ; a = d * sin(e * pi/32) _Sine:: ld a, e calc_sine_wave