diff skaapsteker/sprites/base.py @ 355:5bdb4677510a

Have fireballs appear in the right place.
author Simon Cross <hodgestar@gmail.com>
date Sat, 09 Apr 2011 14:02:13 +0200
parents 4e158a7bd119
children 02bf05964619
line wrap: on
line diff
--- a/skaapsteker/sprites/base.py	Sat Apr 09 14:01:32 2011 +0200
+++ b/skaapsteker/sprites/base.py	Sat Apr 09 14:02:13 2011 +0200
@@ -89,7 +89,10 @@
                         self._animations[name].append((img, collide_rect))
 
         self.collide_rect = Rect((0, 0), (2, 2))
-        self.collide_rect.midbottom = (pos[0]*TILE_SIZE[0]+TILE_SIZE[0]/2, (pos[1]+1)*TILE_SIZE[1])
+        if isinstance(pos, pygame.Rect):
+            self.collide_rect.midbottom = pos.midbottom
+        else:
+            self.collide_rect.midbottom = (pos[0]*TILE_SIZE[0]+TILE_SIZE[0]/2, (pos[1]+1)*TILE_SIZE[1])
         self._update_image()
         self.setup(**opts)