Commits

Rob Leachman  committed 8b496f5

Gradient polish the win/lose screens; bugfixes; save my Photoshop sources

  • Participants
  • Parent commits 39e5e8d

Comments (0)

Files changed (15)

File Graphics/Photoshop/effectsIcon.psd

Added
New image

File Graphics/Photoshop/generating.psd

Added
New image

File Graphics/Photoshop/generator.psd

Added
New image

File Graphics/Photoshop/instructions.psd

Added
New image

File Graphics/Photoshop/laser.psd

Added
New image

File Graphics/Photoshop/manAndBot.psd

Added
New image

File Graphics/Photoshop/mother.psd

Added
New image

File Graphics/Photoshop/musicIcon.psd

Added
New image

File Graphics/Photoshop/pad-GeneratorFactoriesStuff.psd

Added
New image

File Graphics/Photoshop/pad1.psd

Added
New image

File Graphics/Photoshop/road3.psd

Added
New image

File Graphics/Photoshop/shields.psd

Added
New image

File Source/YourStuff.py

         coordY = enviro.getLocationY(0)
         for i in range(10):
             pygame.draw.rect(enviro.screen, [255,0,0], 
-                [(coordX + 5) + (i+1) * 7,(coordY + 20),5,5],0)
+                [(coordX + 5) + (i+1) * 7,(coordY + 20),5,2],0)
         
     def needMoney(self):
         #print "NEED MONEY"
                 if enviro.NEED_MONEY_TO_BUILD and not enviro.credits > 999:
                     #print "Need 1000 for factory, you only have ", enviro.credits
                     enviro.factory.needMoney()
-                elif self.carrying == 0:
+                elif self.carrying == 0 or self.carrying == 2:
                     #print "need stuff to make a bot!"
                     enviro.factory.needStuff()
                 else:

File Source/enviro.py

 testing_modules = 0
 try:
     from Source import AAAmytest
-    print AAAmytest.test
     test = AAAmytest.test
-    print AAAmytest.testMenuSkip
     testMenuSkip = AAAmytest.testMenuSkip
-    print AAAmytest.testEntryScreenSkip
     testEntryScreenSkip = AAAmytest.testEntryScreenSkip
-    print AAAmytest.testing_modules
-    testing_modules = AAAmytest.testing_modules
 except ImportError:
-    #print "prod mode!"
-    pass
-
+    try:
+        import AAAmytest
+        test = AAAmytest.test
+        testMenuSkip = AAAmytest.testMenuSkip
+        testEntryScreenSkip = AAAmytest.testEntryScreenSkip
+        testing_modules = 1
+    except:
+        #print "prod mode!"
+        pass
 
 """ GLOBAL variables """
 """ First some static items we need to run the game:"""

File Source/mainline.py

 from MenuClass import cMenu, EVENT_CHANGE_STATE
 from Harvester import Harvester
 from Generator import Generator
+from GasFactory import GasFactory # for testing
+import gradients
 import mainline # seems wacky but we need it for getattr on functions located here
 
 # Less interesting mainline functions
     enviro.screen = pygame.display.set_mode([800,600])
 
 def loser(bailouts):
-    enviro.screen.fill([0,0,0]) 
-    pygame.draw.rect(enviro.screen, [255,255,255], [100,200,600,200], 0)
+    #enviro.screen.fill([0,0,0]) 
+    enviro.screen.blit(gradients.vertical_func((800,600),(200,200,200),(255,0,0)), (0,0))
+    enviro.screen.blit(gradients.vertical_func((600,200),(255,255,255),(128,128,128)), (100,200))
     #loser = "LOSER" #funny stuff!
     loser = "YOU LOST"
     font = pygame.font.Font(None, 160)
     pygame.display.flip()  
         
 def winner(difficulty):
-    enviro.screen.fill((0,0,0))
-    pygame.draw.rect(enviro.screen, [255,255,255], [100,200,600,200], 0)
-    loser = "YOU WIN!"
+    #enviro.screen.fill((0,0,0))
+    enviro.screen.blit(gradients.vertical_func((800,600),(200,200,200),(0,0,255)), (0,0))
+    #pygame.draw.rect(enviro.screen, [255,255,255], [100,200,600,200], 0)
+    enviro.screen.blit(gradients.vertical_func((600,200),(255,255,255),(128,128,128)), (100,200))
+    loser = "WINNER!"
     font = pygame.font.Font(None, 160)
     loser_text = font.render(loser, 1, (0,0,0))
     loser_pos = [150, 210]
     loser_text = font.render(loser, 1, (0,0,0))
     loser_pos = [285, 360]
     enviro.screen.blit(loser_text, loser_pos)  
-    pygame.display.flip()
+    pygame.display.flip()
+    
+
+if __name__ == '__main__':
+    
+    pygame.init()
+    enviro.screen = pygame.display.set_mode([800,600])
+    myClock = pygame.time.Clock()
+    
+    delay=100
+    interval=50
+    pygame.key.set_repeat(delay,interval)
+    
+# stuff needed for init:
+    enviro.gasFactory = GasFactory("gasFactoryPad.png", 0,0, 
+               "needGrand0-white.png", 
+               "needGrand0.png", 
+               "needGrand1.png", 
+               "needGrand2.png", 
+               "needStuff.png", 
+               "gasFactory.png")
+            
+    while True:
+        
+        for event in pygame.event.get():
+            if event.type == pygame.QUIT:
+                sys.exit()
+            elif (event.type == pygame.KEYDOWN):
+                if (pygame.key.get_mods() == 1024): # command key
+                    if (event.key == 113):   # q
+                        sys.exit()
+                        
+                if event.key == pygame.K_SPACE:
+                    loser(0)
+                if event.key == pygame.K_x:
+                    winner("Easy")                    
+        
+        myClock.tick(30)
+        pygame.display.flip()