Mercurial > skaapsteker
diff skaapsteker/sprites/player.py @ 627:35919d12b792
Path-based collision minimisation and axis-projection backout.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 07 May 2011 20:28:06 +0200 |
parents | 65881746dc20 |
children | 1fdfc7f03d98 |
line wrap: on
line diff
--- a/skaapsteker/sprites/player.py Sat May 07 17:29:10 2011 +0200 +++ b/skaapsteker/sprites/player.py Sat May 07 20:28:06 2011 +0200 @@ -41,7 +41,6 @@ } self._inv_cache = {} # invisible fox image cache self._shield_cache = {} # shielded fox image cache - self._shield_image = 0 # shield image # State flags and such self.attacking = 0 self.running = False @@ -120,7 +119,8 @@ cur_pos = (0, 0) # TODO: can save a lot of calculation here by caching collision rects cand_image = images[int(self._animation_frame)] - cand_collide_rect = cand_image.get_bounding_rect(1).inflate(-2,-2) + # cand_collide_rect = cand_image.get_bounding_rect(1).inflate(-2,-2) + cand_collide_rect = cand_image.get_bounding_rect(1) cand_rect = cand_image.get_rect() cand_rect_offset = cand_rect.centerx - cand_collide_rect.centerx, cand_rect.bottom - cand_collide_rect.bottom cand_rect.midbottom = cur_pos[0] + cand_rect_offset[0], cur_pos[1] + cand_rect_offset[1]