#NEWLINE# def update_hitbox( self ) : #NEWLINE# #INDENT# x = self . head . pos . x #NEWLINE# y = self . head . pos . y #NEWLINE# if ( self . dir . x == 0 ) : #NEWLINE# #INDENT# w = self . width #NEWLINE# h = percent_round_int ( self . width , 0.25 ) #NEWLINE# if ( self . dir . y == 1 ) : #NEWLINE# #INDENT# y += percent_round_int ( h . width , 1.0 ) #NEWLINE# #UNINDENT# if ( self . dir . y == ( - 1 ) ) : #NEWLINE# #INDENT# y -= percent_round_int ( self . width , 0.25 ) #NEWLINE# #UNINDENT# #UNINDENT# if ( self . dir . y == 0 ) : #NEWLINE# #INDENT# w = percent_round_int ( self . width , 0.25 ) #NEWLINE# h = self . width #NEWLINE# if ( self . dir . x == 1 ) : #NEWLINE# #INDENT# x += percent_round_int ( self . width , 1.0 ) #NEWLINE# #UNINDENT# if ( self . dir . x == ( - 1 ) ) : #NEWLINE# #INDENT# x -= percent_round_int ( self . width , 0.25 ) #NEWLINE# #UNINDENT# #UNINDENT# if self . update_head : #NEWLINE# #INDENT# image = pygame . Surface ( ( w , h ) ) #NEWLINE# image . fill ( ( 0 , 0 , 0 ) ) #NEWLINE# image . set_colorkey ( ( 0 , 0 , 0 ) ) #NEWLINE# pygame . draw . rect ( image , ( 255 , 0 , 0 ) , ( 0 , 0 , w , h ) , 0 ) #NEWLINE# self . head . image = image #NEWLINE# self . head . rect = self . head . image . get_rect ( ) #NEWLINE# self . update_head = False #NEWLINE# #UNINDENT# self . head . rect . center = ( x , y )