#NEWLINE# def tick( life ) : #NEWLINE# #INDENT# if life [ 'actions' ] : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# _needs_to_meet = brain . retrieve_from_memory ( life , 'needs_to_meet' ) #NEWLINE# for need in _needs_to_meet : #NEWLINE# #INDENT# movement . collect_nearby_wanted_items ( life , matches = need [ 'match' ] , only_visible = False ) #NEWLINE# break #NEWLINE# #UNINDENT# _needs_to_satisfy = brain . retrieve_from_memory ( life , 'needs_to_satisfy' ) #NEWLINE# for need in _needs_to_satisfy : #NEWLINE# #INDENT# survival . satisfy ( life , need )