# HG changeset patch # User Simon Cross # Date 1673713163 -3600 # Node ID 3fdbde59dc8ab15b14c96ce0680986c787fc623e # Parent 72539d49c426d4bbe868a9bf5e274ff1aecea66c Correct new tile calculation to use integer division (as was always intended for snakes). diff -r 72539d49c426 -r 3fdbde59dc8a mamba/snake.py --- a/mamba/snake.py Wed Jan 11 21:07:25 2023 +0200 +++ b/mamba/snake.py Sat Jan 14 17:19:23 2023 +0100 @@ -271,7 +271,7 @@ # (Tri-state logic is the mamba's natural habitat) if dx != 0: newdx = rx + ds * dx - newtx = newdx / TX + newtx = newdx // TX if newtx > tx: self.set_tile_pos((tx + 1, ty)) ds = newdx - self.rect.left @@ -282,7 +282,7 @@ return True, ds else: newdy = ry + ds * dy - newty = newdy / TY + newty = newdy // TY if newty > ty: self.set_tile_pos((tx, ty + 1)) ds = newdy - self.rect.top