Changeset 151:06be025c821c


Ignore:
Timestamp:
Apr 5, 2011, 6:17:08 PM (9 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Message:

Use midbottom, rather than bottomleft, when changing fox frames

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/player.py

    r149 r151  
    4141            self._animation_frame = 0.0
    4242        if self.rect:
    43             cur_pos = self.collide_rect.bottomleft
     43            cur_pos = self.collide_rect.midbottom
    4444        else:
    4545            cur_pos = (0, 0)
    4646        cand_image = images[int(self._animation_frame)]
    4747        cand_collide_rect = cand_image.get_bounding_rect(1)
    48         cand_collide_rect.bottomleft = cur_pos
     48        cand_collide_rect.midbottom = cur_pos
    4949        if cand_collide_rect.collidelist(self._recent_collisions) != -1 \
    5050                and self.collide_rect.collidelist(self._recent_collisions) == -1:
     
    5454        self.collide_rect = self.image.get_bounding_rect(1)
    5555        self.rect = self.image.get_rect()
    56         self.rect_offset = self.rect.left - self.collide_rect.left, self.rect.bottom - self.collide_rect.bottom
    57         self.collide_rect.bottomleft = cur_pos
    58         self.rect.bottomleft = cur_pos[0] + self.rect_offset[0], cur_pos[1] + self.rect_offset[1]
     56        self.rect_offset = self.rect.centerx - self.collide_rect.centerx, self.rect.bottom - self.collide_rect.bottom
     57        self.collide_rect.midbottom = cur_pos
     58        self.rect.midbottom = cur_pos[0] + self.rect_offset[0], cur_pos[1] + self.rect_offset[1]
    5959        self.init_pos()
    6060
Note: See TracChangeset for help on using the changeset viewer.