Source

pygamegsoc12 / alchemymadness / main.py

Diff from to

alchemymadness/main.py

 from pygame.locals import *
 
 import resources
+import layout
 import potion
 import blocks
 
-SCREEN_SIZE = (800, 600)
-
-
 def main():
     """ your app starts here
     """
 
     pygame.init()
-    screen = pygame.display.set_mode(SCREEN_SIZE)
-    pygame.display.set_caption("alchemymadness")
+    screen = pygame.display.set_mode(layout.screen_size)
+    pygame.display.set_caption("Alchemy Madness")
     clock = pygame.time.Clock()
     going = True
 
     pot = potion.Potion()
     pot.set_formula(3, 5, 3)
     sprites = pygame.sprite.LayeredDirty(pot)
-
+    sprites.clear(screen, resources.background)
 
     grds = blocks.Grids(sprites)
 
                 pot.add_color((255,0,0))
             if e.type == KEYDOWN and e.key == K_s:
                 pygame.image.save(screen, "screeny.png")
-                
+
             if e.type == KEYDOWN:
                 if e.key == K_LEFT:
                     blks.action_move_left()
                     blks.action_move_up()
                 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
 
         # Update sprites
-        sprites.clear(screen, resources.background)
         sprites.update(time)
-
         # Draw sprites
         rects = sprites.draw(screen)
+        # TODO: Move text code somewhere else
+        screen.blit(resources.font[40].render('Alchemy Madness', True, (255,255,255)), (10,550))
         pygame.display.update(rects)