Nov-01-2019, 03:18 PM
What about this?
def update(self): direction = +1 if self.game.player.weapon == 'boomerang': now = pg.time.get_ticks() if now - self.last >= self.cooldown: direction = -1 self.pos += self.vel * self.game.dt * direction self.rect.center = self.pos