Exemple #1
0
 def update(self):
     ''' Update
     Updates using parent classes update function, then ensures still
     on screen
     '''
     #print(self.score)
     Character.update(self)
     # Preventing from going off edges
     if self.rect.left < 0:
         self.rect.left = 0
     if self.rect.right > self.screen.get_width():
         self.rect.right = self.screen.get_width()
Exemple #2
0
    def update(self):
        ''' NPC update function

        This function examines position of target, makes move based on 
        target, then uses parent classes update funciton
        '''
        if self.position[1] > self.max_depth:
            self.kill()
        # Deciding on and actioning any moves
        self.decideMoves()

        Character.update(self)