From 6fad179c71412061cd4b1cc4d79e407ccc47780f Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 11 May 2014 23:46:33 +0200 Subject: [PATCH] Start of GameBits --- naja/scenes/game.py | 2 +- naja/widgets/game_bits.py | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/naja/scenes/game.py b/naja/scenes/game.py index f3db806..1f95a77 100644 --- a/naja/scenes/game.py +++ b/naja/scenes/game.py @@ -22,7 +22,7 @@ class GameScene(Scene): super(GameScene, self).__init__(state) self.add(PlayerBitsWidget((0, 0), state)) self.add(BoardWidget((0, 60), state)) - self.add(GameBitsWidget((0, 540))) + self.add(GameBitsWidget((0, 540), state)) self.add(InfoAreaWidget((480, 0))) self.add(RobotWidget(state)) diff --git a/naja/widgets/game_bits.py b/naja/widgets/game_bits.py index 682d520..2175658 100644 --- a/naja/widgets/game_bits.py +++ b/naja/widgets/game_bits.py @@ -2,7 +2,9 @@ Widget that holds the games's bits. """ -from naja.constants import BIT_SIZE +import pygame + +from naja.constants import BIT_SIZE, BITS from naja.widgets.base import Widget @@ -10,12 +12,12 @@ class GameBitsWidget(Widget): """ Widget which holds the game's bits. """ - def __init__(self, pos, image=None): + def __init__(self, pos, state): super(GameBitsWidget, self).__init__(pos, BIT_SIZE) + self.state = state def prepare(self): - pass + self.surface = pygame.Surface(BIT_SIZE) def draw(self, surface): - pass - #surface.blit(self.surface, self.pos) + surface.blit(self.surface, self.pos) -- 2.34.1