def prepare(self):
self.surface = pygame.Surface(BIT_SIZE)
- bits = (
- (BITS.MSB, 'msb', ()),
- (BITS.YELLOW, 'yellow', ()),
- (BITS.MAGENTA, 'magenta', ()),
- (BITS.CYAN, 'cyan', ()),
- (BITS.WEST, 'arrow', ()),
- (BITS.EAST, 'arrow', ()),
- (BITS.SOUTH, 'arrow', ()),
- (BITS.NORTH, 'arrow', ()),
- )
- for pos, (bit, image, transforms) in enumerate(bits):
- is_set = self.state.player.bits.check_bit(bit)
+ health = self.state.gameboard.health
+ wins = self.state.gameboard.wins
+
+ bits = []
+ bits.extend(
+ (i < health, 'health', ()) for i in range(4))
+ bits.extend(
+ (i < wins, 'win', ()) for i in range(4))
+
+ for pos, (is_set, image, transforms) in enumerate(bits):
img = resources.get_image(
'bits', '%s_%s.png' % (image, 'on' if is_set else 'off'),
transforms=transforms)