Nov-03-2019, 07:25 PM
I now have got this and it isn't working:
def update(self): if self.game.player.weapon == 'boomerang': self.direction = +1 now = pg.time.get_ticks() if self.direction == +1: self.pos += self.vel * self.game.dt if self.direction == -1: self.pos -= self.vel * self.game.dt if now - self.last >= self.cooldown: self.direction = -1 #self.pos -= self.vel * self.game.dt self.pos += self.vel * self.game.dt self.rect.center = self.posDidn't I understood that self.direction thing or what is the problem with the code?