changeset 107:672cc5598e77

Fix dist metric
author Neil Muller <drnlmuller@gmail.com>
date Wed, 02 Sep 2009 18:26:15 +0000
parents 6115d89e3ca9
children 437cbd856a03
files gamelib/misc.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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)