def cohere(self, flockmates): max_cohere_turn = gui_get('max-cohere-turn') avg_heading_toward_flockmates = self.average_heading_toward_flockmates( flockmates) amount_to_turn = utils.turn_toward_amount( self.heading, avg_heading_toward_flockmates, max_cohere_turn) self.turn_right(amount_to_turn)
def align(self, flockmates): max_align_turn = gui_get('max-align-turn') average_flockmate_heading = self.average_flockmate_heading(flockmates) amount_to_turn = utils.turn_toward_amount(self.heading, average_flockmate_heading, max_align_turn) self.turn_right(amount_to_turn)