Start of GameBits
authorStefano Rivera <stefano@rivera.za.net>
Sun, 11 May 2014 21:46:33 +0000 (23:46 +0200)
committerStefano Rivera <stefano@rivera.za.net>
Sun, 11 May 2014 21:46:33 +0000 (23:46 +0200)
naja/scenes/game.py
naja/widgets/game_bits.py

index f3db806a1403c4a6eee582066402cb614668b6bf..1f95a77402c53333d9a82489d084022d103b09fb 100644 (file)
@@ -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))
 
index 682d520531a366790727212ac3786dc2c35d46da..21756586bf80276ea1ea28f072c81b252c22e81c 100644 (file)
@@ -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)