Mercurial > rinkhals
diff gamelib/misc.py @ 107:672cc5598e77
Fix dist metric
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Wed, 02 Sep 2009 18:26:15 +0000 |
parents | e90068d1f374 |
children | 1a7000c8211c |
line wrap: on
line diff
--- a/gamelib/misc.py Wed Sep 02 18:19:03 2009 +0000 +++ b/gamelib/misc.py Wed Sep 02 18:26:15 2009 +0000 @@ -13,7 +13,7 @@ def dist(self, b): """Gives the distance to another position""" - return abs(self.x - b.x) + abs(self.y - b.y) + return max(abs(self.x - b.x), abs(self.y - b.y)) def __sub__(self, b): return Position(self.x - b.x, self.y - b.y)