#NEWLINE# def handle_key( self ) : #NEWLINE# #INDENT# if self . tile_with_player . key : #NEWLINE# #INDENT# self . score += ( 5 * self . difficulty ) #NEWLINE# self . parent . counter . update_counter ( 0 , ( 5 * self . difficulty ) ) #NEWLINE# self . player_has_keys . append ( self . tile_with_player . key_type ) #NEWLINE# key_anim = Animation ( x = self . tile_with_player . key . x , y = ( self . tile_with_player . key . y + 80 ) , duration = 0.15 ) #NEWLINE# key_anim . start ( self . tile_with_player . key ) #NEWLINE# key_id = self . tile_with_player . key_type #NEWLINE# if ( key_id == 'keyYellow' ) : #NEWLINE# #INDENT# self . parent . star_counter . ids . keyYellow . source = key_sources [ self . tile_with_player . key_type ] #NEWLINE# self . parent . star_counter . ids . keyYellow . reload ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key_id == 'keyGreen' ) : #NEWLINE# #INDENT# self . parent . star_counter . ids . keyGreen . source = key_sources [ self . tile_with_player . key_type ] #NEWLINE# self . parent . star_counter . ids . keyGreen . reload ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key_id == 'keyOrange' ) : #NEWLINE# #INDENT# self . parent . star_counter . ids . keyOrange . source = key_sources [ self . tile_with_player . key_type ] #NEWLINE# self . parent . star_counter . ids . keyOrange . reload ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key_id == 'keyBlue' ) : #NEWLINE# #INDENT# self . parent . star_counter . ids . keyBlue . source = key_sources [ self . tile_with_player . key_type ] #NEWLINE# self . parent . star_counter . ids . keyBlue . reload ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# key_anim . bind ( on_complete = self . tile_with_player . remove_key ) #NEWLINE# if self . soundsOption : #NEWLINE# #INDENT# pick_key_sound = SoundLoader . load ( 'assets/audio/pick_key.ogg' ) #NEWLINE# pick_key_sound . play ( )