Commits

Rob Leachman  committed 09c33fa

Version 1.1 release candidate

  • Participants
  • Parent commits 8b496f5

Comments (0)

Files changed (9)

File Graphics/Photoshop/shields.psd

Old
Old image
New
New image

File Graphics/shields.png

Old
Old image
New
New image

File Graphics/shieldsUp.png

Old
Old image
New
New image

File ProduceDefendWin.py

+#! /usr/bin/env python
 # coding=UTF8
 # Copyright © 2010 Rob Leachman
 # Please see the file COPYING in this distribution for license information
-## #! /usr/bin/env python
+#
 # ProduceDefendWin.py
+#  My first Pygame, an execuse to learn Python and teach my man Steven
 #
-# My first Python game, learned a lot and there's a ton I'd do differently
-# but rather than spend more time here... get it out and move on. But I'm
-# interested in any comments anyone would have. Reasonably satisified
+# Version history:
+#   1.1 - Tidy up, fix some graphics, smarter bots, fixed mothership "mercy"
+#         bug where she'd stop coming after about 8 kills... I forget what
+#         else, version history what a concept! 
+#
+#   1.0 - Project completed, I'm actually releasing a "finished" game!
+#
+# Rambling:
+# 1.1 I've watched a bit of beta play and really need to do something about
+# the standoff condition when the player misses "ideal strategy" and ends up
+# just killing the mothership over and over. If we were in the arcades the
+# choice would be easy -- just slaughter the player and demand another
+# quarter. Maybe that's best but seems mean... though the alternative is to
+# let them win and that's no good either. For now I'll just release and keep
+# thinking about this.
+#
+# 1.0 My first Python game, learned a lot and there's a ton I'd do 
+# differently but rather than spend more time here... get it out and move on. 
+# I'm interested in any comments anyone would have. Reasonably satisified
 # with how it turned out :)
+# --------------------------------------------------------------------------
 #
 # I've left a ton of crummy notes to myself in the code, here are a few:
 #
 
 from Source import pyconsole
 from Source import pyconsole_syntax
-#    re_add, console_add, re_function, console_func
+#    re_add, console_add, re_function, console_func ## took the easy way out
 from Source import pyconsole_functions, fps, cheat, line
 
 from Source import enviro # my global game environment
-from Source import Noise # the noise module, all the music and effects stuff go here
+from Source import Noise # all the music and effects stuff should be here
 
 from Source import YourStuff
 from Source import AttackerStuff
 from Source import mainline
 
 
-
 def main(continuing, firstRun):
     
     if firstRun:

File Source/Harvester.py

             self.cooldown = self.cooldown - 1
             if self.cooldown < 1:
                 self.state = "Idle"
+                
+        # A new "first priority" (sigh), can't let all production die!
+        allAreEmpty = False
+        if self.state == "Idle" and enviro.gasFactory.built == 1:
+            allAreEmpty = True
+            for generator in generators:
+                if not generator.checkTankEmpty():
+                    allAreEmpty = False
         
         # First priority is to capitalize on when she's dead, sell
         if self.state == "Idle" and base.isFull():
         # Under combat, don't let the shields or laser run dry...
         # but they don't need to be chock full either, not if we've got
         # a generator out of gas
-        if self.state == "Idle":
-            # Be sure the shields are pumping safety above our head
-            if shields.nearlyEmpty():
+        if (self.state == "Idle" or self.state == "Stuck") and not allAreEmpty:
+            # Be sure we can blast away at our attackers
+            if laser.nearlyEmpty():
+                if base.getStuff():
+                    self.state = "Reenergizing"
+                    laser.promiseRefuel()
+                    self.target = 10
+                    self.progress = 0
+                    self.spawn()
+            # ...and be sure to keep a roof over our head
+            elif shields.nearlyEmpty():
                 if base.getStuff():
                     self.state = "Fueling"
                     shields.promiseRefuel()
                     self.target = 9 # the shield generator
                     self.progress = 0
                     self.spawn()
-            # ...and then be sure we're blasting anything we can
-            elif laser.nearlyEmpty():
-                if base.getStuff():
-                    self.state = "Reenergizing"
-                    laser.promiseRefuel()
-                    self.target = 10
-                    self.progress = 0
-                    self.spawn()                        
                         
         # They're not running dry, so next priority is to keep the generators fueled up
         if self.state == "Idle" and enviro.gasFactory.built == 1:

File Source/MotherShip.py

                         
         if self.state == "Waiting":
             self.waitCount = self.waitCount - 1
-            if self.waitCount == 0:
+            if self.waitCount < 1:
                 self.state = "Approaching"
                 
         if self.state == "Approaching":
             
         if self.state == "Hit":
             self.hitCount += 1
-            print "The mother has died ",self.hitCount," times, do we need a mercy rule?"
+            #print "The mother has died ",self.hitCount," times, do we need a mercy rule?"
             self.state = "Waiting"
             self.waitCount = enviro.MOTHER_RESTART_WAIT - self.fasterNextTime
             if self.waitCount < 0:

File Source/Shields.py

         return shieldSprite
         
     def powerUp(self, power, fuelPile):
-        pygame.draw.rect(enviro.screen, [0,0,0], [530,425,68,28], 0) # clear the powerup indicator
+        pygame.draw.rect(enviro.screen, [0,0,0], [520,427,90,24], 0) # clear the powerup indicator
         if self.consuming > 0:
             if power < enviro.SHIELD_MAX:
-                enviro.screen.blit(self.increasingImage, [530,420])
+                enviro.screen.blit(self.increasingImage, [520,426])
                 
                 if self.needHum:
                     #self.powerUpAnimationLine = 420
                     self.powerUpAnimationLine = 9
                 
                 for i in range(self.powerUpAnimationLine, 27,10):
-                     pygame.draw.lines(enviro.screen, [0,0,0], False, [[530,self.powerUpAnimationLine+i+420],[601,self.powerUpAnimationLine+i+420]], 3)
+                     pygame.draw.lines(enviro.screen, [0,0,0], False, [[520,self.powerUpAnimationLine+i+416],[610,self.powerUpAnimationLine+i+416]], 3)
                 
                 power = power + enviro.SHIELD_POWER_PER_CYCLE
                 if power > enviro.SHIELD_MAX:
         fuelState = FuelStuff(fuelFile)
         fuelPile.append(fuelState)
         
-    dramaBackground = pygame.image.load("dramaBackground.png") 
+    dramaBackground = \
+        pygame.image.load(os.path.join(enviro.artPathHack,'dramaBackground.png'))    
  
     shieldsFile = "shields.png"
     shieldsIncreasingFile = "shieldsUp.png"
 ##    soundEffect.append(Noise.load_sound('25322_Therac_25_starshiphum.wav'))
 ##    Noise.SHIELD_HUM = len(soundEffect) - 1  
 
-    enviro.start()
+    enviro.init()
+    enviro.start("Easy")
     
     s = Shields(shieldsFile, shieldsIncreasingFile, [10,10,10])
     s.paint([520,450], fuelPile)
-    shieldPower = 1000
+    shieldPower = 2050
 
     while True:
         hit = False

File Source/enviro.py

         enviro.YOURSPEED = 20
         
         #enviro.LASER_POWER = 1000
-        enviro.shieldUpgrades = 10
+        enviro.shieldUpgrades = 1
         enviro.laserUpgrades = 10
         
         enviro.credits = 0

File Source/mainline.py

     enviro.screen.blit(fpsOut, [10,460])    
 
 def menu():
-    enviro.screen.fill((0,0,0)) # love the black screen
+    #enviro.screen.fill((0,0,0)) # love the black screen
+    enviro.screen.blit(gradients.vertical_func((800,600), (128,128,128), (0,0,0)), (0,0))
     
     menu = cMenu(50, 50, 20, 5, 'vertical', 100, enviro.screen,
                [('Easy - Instruction Mode', 1, None),
     screenrect = pygame.Rect(0, 0, 800, 600) 
     bestdepth = pygame.display.mode_ok(screenrect.size, pygame.FULLSCREEN, 32)
     enviro.screen = pygame.display.set_mode(screenrect.size, pygame.FULLSCREEN, bestdepth) 
+    enviro.screen.blit(gradients.vertical_func((800,600), (128,128,128), (0,0,0)), (0,0))    
     
 def setWindowed():
     enviro.screen = pygame.display.set_mode([800,600])