Source

pygamegsoc12 / alchemymadness / main.py

Diff from to

File alchemymadness/main.py

     # Initialise level
     pot = potion.Potion()
     pot.set_formula(3, 5, 3)
-    grd = blocks.Grid(small = True)
-    blks = blocks.Blocks(grd)
     sprites = pygame.sprite.LayeredDirty(pot)
-    for b in blks.blocks:
-        sprites.add(b)
+
+
+    grds = blocks.Grids()
+    for grd in grds.grids:
+        for b in grd.blocks.blocks:
+            sprites.add(b)
+
+    blks = grds.grids[0].blocks
+
 
     #TEST
     pot.add_color((0,0,255))
                 if e.key == K_DOWN:
                     blks.action_move_down()
             
-
+                # press keys 1-4 to control player 1-4.
+                if e.key in [K_1, K_2, K_3, K_4]:
+                    which_player = [K_1, K_2, K_3, K_4].index(e.key)
+                    blks = grds.grids[which_player].blocks
+                    
             if e.type == QUIT or e.type == KEYDOWN and e.key == K_ESCAPE:
                 going = False