comparison skaapsteker/levelscene.py @ 523:c7c3f55554d4

add tofu and scroll totals to the hud
author Adrianna Pińska <adrianna.pinska@gmail.com>
date Sat, 09 Apr 2011 23:45:00 +0200
parents a89ab402b569
children b7f912705adb
comparison
equal deleted inserted replaced
522:4de4f94c326d 523:c7c3f55554d4
277 bar.height = int(fox_hud.HEALTH_HEIGHT * float(max(0, fox.cur_health))/fox.max_health) 277 bar.height = int(fox_hud.HEALTH_HEIGHT * float(max(0, fox.cur_health))/fox.max_health)
278 bar.bottomleft = health_bottom 278 bar.bottomleft = health_bottom
279 pygame.draw.rect(self._level_surface, fox_hud.HEALTH_FOREGROUND, bar) 279 pygame.draw.rect(self._level_surface, fox_hud.HEALTH_FOREGROUND, bar)
280 280
281 # Draw scroll count 281 # Draw scroll count
282 pos = self._clip_rect.right - 20, self._clip_rect.top + fox_hud.SCROLL_TOP + 5 282 pos = self._clip_rect.right - 35, self._clip_rect.top + fox_hud.SCROLL_TOP + 30
283 count = Text("%s" % len(fox.scrolls), pos) 283 count = Text("%s/5" % len(fox.scrolls), pos)
284 count.draw(self._level_surface) 284 count.draw(self._level_surface)
285 pos = self._clip_rect.right - 55, self._clip_rect.top + fox_hud.SCROLL_TOP 285 pos = self._clip_rect.right - 35, self._clip_rect.top + fox_hud.SCROLL_TOP
286 self._level_surface.blit(self._scroll, pos) 286 self._level_surface.blit(self._scroll, pos)
287 287
288 # Draw tofu count 288 # Draw tofu count
289 pos = self._clip_rect.right - 20, self._clip_rect.top + fox_hud.TOFU_TOP + 5 289 pos = self._clip_rect.right - 42, self._clip_rect.top + fox_hud.TOFU_TOP + 28
290 count = Text("%s" % fox.tofu, pos) 290 count = Text("% 3s%%" % fox.tofu, pos)
291 count.draw(self._level_surface) 291 count.draw(self._level_surface)
292 pos = self._clip_rect.right - 55, self._clip_rect.top + fox_hud.TOFU_TOP 292 pos = self._clip_rect.right - 35, self._clip_rect.top + fox_hud.TOFU_TOP
293 self._level_surface.blit(self._tofu, pos) 293 self._level_surface.blit(self._tofu, pos)
294 294
295 295
296 def _update_clip_rect(self): 296 def _update_clip_rect(self):
297 cr = self._clip_rect 297 cr = self._clip_rect