Changeset 147:887d69907b22


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

Use bottomleft, so we stay above the floor as we change frames

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/sprites/player.py

    r144 r147  
    4040            self._animation_frame = 0.0
    4141        if self.rect:
    42             cur_pos = self.collide_rect.topleft
     42            cur_pos = self.collide_rect.bottomleft
    4343        else:
    4444            cur_pos = (0, 0)
     
    4646        self.rect = self.image.get_rect()
    4747        self.collide_rect = self.image.get_bounding_rect(1)
    48         self.rect_offset = self.rect.left - self.collide_rect.left, self.rect.top - self.collide_rect.top
    49         self.collide_rect.topleft = cur_pos
    50         self.rect.topleft = cur_pos[0] + self.rect_offset[0], cur_pos[1] + self.rect_offset[1]
     48        self.rect_offset = self.rect.left - self.collide_rect.left, self.rect.bottom - self.collide_rect.bottom
     49        self.collide_rect.bottomleft = cur_pos
     50        self.rect.bottomleft = cur_pos[0] + self.rect_offset[0], cur_pos[1] + self.rect_offset[1]
    5151        self.init_pos()
    5252
Note: See TracChangeset for help on using the changeset viewer.