Advertisement
Guest User

Untitled

a guest
Nov 14th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. axis = self.player_loc[direction]
  2.  
  3. for i, amount in enumerate(self.calculate(*_split_decimal_part(amount))):
  4. try:
  5. axis[i] += amount
  6. except IndexError:
  7. axis.append(amount)
  8.  
  9. overflow = 0
  10. for i, amount in enumerate(axis):
  11. amount += overflow
  12. negative = math.copysign(1, amount)
  13. overflow, remainder = [n * negative for n in divmod(abs(amount), self.BLOCK_SIZE)]
  14. self.player_loc[direction][i] = remainder
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement