Пример #1
0
    def update(self):
        """moves the bullet in the direction of the target"""

        selfx, selfy = self.rect.center
        targx, targy = self.target.rect.center
        direction = round_to_45(get_direction(self.rect.center, self.target.rect.center))

        self.move(direction)
Пример #2
0
    def update(self):
        """moves the bullet in the direction of the target"""

        selfx, selfy = self.rect.center
        targx, targy = self.target.rect.center
        direction = round_to_45(
            get_direction(self.rect.center, self.target.rect.center))

        self.move(direction)
Пример #3
0
 def update(self):
     self.sprite.update()
     
     self.tick += 1
     
     if self.tick == self.targ_time:
         self.target_direction = vector.normalize(vector.get_direction(self.sprite.rect.center, self.target.rect.center))
     if self.tick == self.shoot_time:
         self.transition_to(self.manager.SHOOTING)
Пример #4
0
    def update(self):
        self.sprite.update()

        self.tick += 1

        if self.tick == self.targ_time:
            self.target_direction = vector.normalize(
                vector.get_direction(self.sprite.rect.center,
                                     self.target.rect.center))
        if self.tick == self.shoot_time:
            self.transition_to(self.manager.SHOOTING)