Source

pygamegsoc12 / alchemymadness / blocks.py

Diff from to

File alchemymadness/blocks.py

         super(Blocks, self).__init__()
 
         self.parent = parent
+        #TODO: randomise these colors.
         self.colors = [(255,0,0), (0,255,0), (0,0,255)]
 
         # how do we handle location, and rotation? We say where the grid it is on.
 
     def has_collided(self):
         """ checks if we have collided with some other blocks.
+              See if the blocks of the same color are below.
         """
         # TODO: self.parent is the grid.
         raise NotImplementedError()
         """ makes this a frozen block in the grid.
         """
         # TODO: self.parent is the grid.
+        #    Probably create a new grid.blocks...
+        #      The Block instances will stay where they are in the sprite_group.
         raise NotImplementedError()
 
 
         self.blocks = Blocks(self)
 
 
+        # TODO: what about frozen Blocks?
+
+
+
+
     def init_grid(self):
         """ init_grid initialises the Grid to be all clear.
         """
     """ This contains all the main Grid objects.
     """
     NUM_GRIDS = 4
-    def __init__(self):
+    def __init__(self, sprite_group):
+        """ sprite_group - which we add sprites to.
         """
-        """
+        self.sprite_group = sprite_group
         self.grids = [Grid(x) for x in range(self.NUM_GRIDS)]
 
+        for grd in self.grids:
+            for b in grd.blocks.blocks:
+                self.sprite_group.add(b)