Mercurial > rinkhals
comparison gamelib/gameboard.py @ 212:b999abd5993b
Fix missed status flag in animations
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Fri, 04 Sep 2009 21:35:40 +0000 |
parents | f82d17f99882 |
children | 07b361ebd87f |
comparison
equal
deleted
inserted
replaced
211:f65e4e5b7347 | 212:b999abd5993b |
---|---|
161 | 161 |
162 def update(self, surface): | 162 def update(self, surface): |
163 us = [] | 163 us = [] |
164 x, y = self.vid.view.x, self.vid.view.y | 164 x, y = self.vid.view.x, self.vid.view.y |
165 for anim in self.gameboard.animations[:]: | 165 for anim in self.gameboard.animations[:]: |
166 """Handle completed animations""" | 166 # We process removed animations 1st, so we redraw things correctly |
167 if anim.removed: | 167 if anim.removed: |
168 us.append(pygame.Rect(anim.irect.x - x, anim.irect.y - y, | 168 us.append(pygame.Rect(anim.irect.x - x, anim.irect.y - y, |
169 anim.irect.width, anim.irect.height)) | 169 anim.irect.width, anim.irect.height)) |
170 self.gameboard.animations.remove(anim) | 170 self.gameboard.animations.remove(anim) |
171 # Flag the underlying tiles/sprites to be redrawn | 171 # Flag the underlying tiles/sprites to be redrawn |
172 self.vid.alayer[anim.pos.y][anim.pos.x]=1 | 172 self.vid.alayer[anim.pos.y][anim.pos.x]=1 |
173 self.vid.updates.append(anim.pos.to_tuple()) | |
173 us.extend(self.vid.update(surface)) | 174 us.extend(self.vid.update(surface)) |
174 for anim in self.gameboard.animations: | 175 for anim in self.gameboard.animations: |
175 if anim.updated: | 176 if anim.updated: |
176 anim.fix_pos(self.vid) | 177 anim.fix_pos(self.vid) |
177 # setimage has happened | 178 # setimage has happened |