Mercurial > rinkhals
comparison gamelib/buildings.py @ 561:7f037ee2a6c8
Show count of selected chickens in buildings
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 18:40:04 +0000 |
parents | 50d6c68ce267 |
children |
comparison
equal
deleted
inserted
replaced
560:8cd13b82585e | 561:7f037ee2a6c8 |
---|---|
291 text = self._font.render(str(count), True, | 291 text = self._font.render(str(count), True, |
292 constants.FG_COLOR) | 292 constants.FG_COLOR) |
293 # Blit to the right | 293 # Blit to the right |
294 x, y = text.get_size() | 294 x, y = text.get_size() |
295 image.blit(text, (w - x, h - y)) | 295 image.blit(text, (w - x, h - y)) |
296 sel_count = len([chick for chick in self.occupants() | |
297 if chick in self.gameboard.selected_chickens]) | |
298 if sel_count: | |
299 text = self._font.render(str(sel_count), True, | |
300 constants.SELECTED_COUNT_COLOR) | |
301 x, y = text.get_size() | |
302 image.blit(text, (0, h - y)) | |
296 # Render predator count | 303 # Render predator count |
297 if self._predators: | 304 if self._predators: |
298 text = self._font.render(str(len(self._predators)), True, | 305 text = self._font.render(str(len(self._predators)), True, |
299 constants.PREDATOR_COUNT_COLOR) | 306 constants.PREDATOR_COUNT_COLOR) |
300 # Blit to the left | 307 # Blit to the left |