#NEWLINE# def animate_movement( self , frames , direction ) : #NEWLINE# #INDENT# self . get_distance ( frames ) #NEWLINE# if self . jumping : #NEWLINE# #INDENT# self . image = self . frames [ 0 ] #NEWLINE# if ( direction == 'left' ) : #NEWLINE# #INDENT# self . image = pygame . transform . flip ( self . image , True , False ) #NEWLINE# self . image = pygame . transform . smoothscale ( self . image , ( self . width , self . height ) ) #NEWLINE# #UNINDENT# self . image = pygame . transform . smoothscale ( self . image , ( self . width , self . height ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( frames . scanned_frame >= len ( frames ) ) : #NEWLINE# #INDENT# self . scanned_frame = 0 #NEWLINE# #UNINDENT# if ( direction == 'left' ) : #NEWLINE# #INDENT# self . image = frames [ self . scanned_frame ] #NEWLINE# self . image = pygame . transform . flip ( self . image , True , False ) #NEWLINE# self . image = pygame . transform . smoothscale ( self . image , ( self . width , self . height ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( direction == 'right' ) : #NEWLINE# #INDENT# self . image = frames [ self . scanned_frame ] #NEWLINE# self . image = pygame . transform . smoothscale ( self . image , ( self . width , self . height ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . scanned_frame += 1