Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- axis = self.player_loc[direction]
- for i, amount in enumerate(self.calculate(*_split_decimal_part(amount))):
- try:
- axis[i] += amount
- except IndexError:
- axis.append(amount)
- overflow = 0
- for i, amount in enumerate(axis):
- amount += overflow
- negative = math.copysign(1, amount)
- overflow, remainder = [n * negative for n in divmod(abs(amount), self.BLOCK_SIZE)]
- self.player_loc[direction][i] = remainder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement