Changeset 349:bc40be4ab5fc


Ignore:
Timestamp:
04/09/11 11:31:57 (12 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Rebase:
35386466623662393065346338306364303532373863623337303630653663623765623231336330
Message:

Fix negative health bar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skaapsteker/levelscene.py

    r348 r349  
    195195        bar.bottomleft = health_bottom
    196196        pygame.draw.rect(self._level_surface, constants.FoxHud.HEALTH_BACKGROUND, bar)
    197         bar.height = int(constants.FoxHud.HEALTH_HEIGHT * float(fox.cur_health)/fox.max_health)
     197        bar.height = int(constants.FoxHud.HEALTH_HEIGHT * float(max(0, fox.cur_health))/fox.max_health)
    198198        bar.bottomleft = health_bottom
    199199        pygame.draw.rect(self._level_surface, constants.FoxHud.HEALTH_FOREGROUND, bar)
Note: See TracChangeset for help on using the changeset viewer.