Commits

Rob Leachman  committed 13db78c

Moved my "art" to the Graphics subdirectory... the base dir is getting tidy!

  • Participants
  • Parent commits 809b7a7

Comments (0)

Files changed (131)

File Graphics/base.png

Added
New image

File Graphics/botEmpty.png

Added
New image

File Graphics/botFactory.png

Added
New image

File Graphics/botFactoryPad.png

Added
New image

File Graphics/botWithGas.png

Added
New image

File Graphics/botWithStuff.png

Added
New image

File Graphics/deadBomb1.png

Added
New image

File Graphics/deadBomb2.png

Added
New image

File Graphics/deadBomb3.png

Added
New image

File Graphics/deadBomb4.png

Added
New image

File Graphics/deadFighter10PxA-1.png

Added
New image

File Graphics/deadFighter10PxA-2.png

Added
New image

File Graphics/deadFighter10PxA-3.png

Added
New image

File Graphics/deadFighter10PxA-4.png

Added
New image

File Graphics/deadFighter10PxA-5.png

Added
New image

File Graphics/deadFighter10PxA-6.png

Added
New image

File Graphics/deadFighter10PxA-7.png

Added
New image

File Graphics/deadFighter10PxA-8.png

Added
New image

File Graphics/effectsIcon.png

Added
New image

File Graphics/fuelStore0.png

Added
New image

File Graphics/fuelStore1.png

Added
New image

File Graphics/fuelStore10.png

Added
New image

File Graphics/fuelStore2.png

Added
New image

File Graphics/fuelStore3.png

Added
New image

File Graphics/fuelStore4.png

Added
New image

File Graphics/fuelStore5.png

Added
New image

File Graphics/fuelStore6.png

Added
New image

File Graphics/fuelStore7.png

Added
New image

File Graphics/fuelStore8.png

Added
New image

File Graphics/fuelStore9.png

Added
New image

File Graphics/gasFactory.png

Added
New image

File Graphics/gasFactoryPad.png

Added
New image

File Graphics/generating-1.png

Added
New image

File Graphics/generating-10.png

Added
New image

File Graphics/generating-2.png

Added
New image

File Graphics/generating-3.png

Added
New image

File Graphics/generating-4.png

Added
New image

File Graphics/generating-5.png

Added
New image

File Graphics/generating-6.png

Added
New image

File Graphics/generating-7.png

Added
New image

File Graphics/generating-8.png

Added
New image

File Graphics/generating-9.png

Added
New image

File Graphics/generator0.png

Added
New image

File Graphics/instructions.png

Added
New image

File Graphics/laser.png

Added
New image

File Graphics/man.png

Added
New image

File Graphics/manWithGas.png

Added
New image

File Graphics/manWithThing.png

Added
New image

File Graphics/market.png

Added
New image

File Graphics/motherDead-1.png

Added
New image

File Graphics/motherDead-2.png

Added
New image

File Graphics/motherDead-3.png

Added
New image

File Graphics/motherDead-4.png

Added
New image

File Graphics/motherDead-5.png

Added
New image

File Graphics/motherDead-6.png

Added
New image

File Graphics/motherDead-7.png

Added
New image

File Graphics/motherDead-8.png

Added
New image

File Graphics/musicIcon.png

Added
New image

File Graphics/myTitle.png

Added
New image

File Graphics/needGrand0-v2.png

Added
New image

File Graphics/needGrand0-white.png

Added
New image

File Graphics/needGrand0.png

Added
New image

File Graphics/needGrand1-v2.png

Added
New image

File Graphics/needGrand1.png

Added
New image

File Graphics/needGrand2.png

Added
New image

File Graphics/needStuff-v2.png

Added
New image

File Graphics/needStuff.png

Added
New image

File Graphics/pad1.png

Added
New image

File Graphics/pauseInstructions.png

Added
New image

File Graphics/road3.png

Added
New image

File Graphics/shields.png

Added
New image

File Graphics/shieldsUp.png

Added
New image

File ProduceDefendWin.py

                         paused = True
                         enviro.musicVolumeController.paintControl() 
                         enviro.effectsVolumeController.paintControl()
-                        enviro.screen.blit(pygame.image.load("effectsIcon.png"), [10,570])
-                        enviro.screen.blit(pygame.image.load("musicIcon.png"), [170,570]) 
+                        enviro.screen.blit(pygame.image.load(os.path.join(enviro.artPathHack,"effectsIcon.png")), [10,570])
+                        enviro.screen.blit(pygame.image.load(os.path.join(enviro.artPathHack,"musicIcon.png")), [170,570]) 
                 elif (pygame.key.get_mods() == 1024): # command key
                     if (event.key == 113):   # q  -- so Apple-Q quits like other programs on OS X
                         sys.exit()

File Source/AttackerStuff.py

 # Please see the file COPYING in this distribution for license information
 import pygame
 import random
+import os
 from pygame.color import THECOLORS
 
 import enviro # my global game environment
     def __init__(self, image_file, left, top, width, height):
         pygame.sprite.Sprite.__init__(self)
         
-        self.image = pygame.image.load(image_file)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,image_file)).convert_alpha()
         self.rect = self.image.get_rect()
 
         self.rect.left = left

File Source/Bomb.py

         else:
             self.theImage = "deadBomb1.png"
             
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         self.rect.center = self.oldCenter
                 

File Source/DeadFighter.py

 # Copyright © 2010 Rob Leachman
 # Please see the file COPYING in this distribution for license information
 import pygame
+import os
 import sys # for testing
 from pygame.color import THECOLORS
 
         
         for i in range (1,9):
             deathFile = filenamePrefix + str(i) + ".png"
-            deathImage = pygame.image.load(deathFile)
-            deathImage.convert()
+            deathImage = pygame.image.load(os.path.join(enviro.artPathHack,deathFile)).convert_alpha()
             self.deathImage.append(deathImage)
             
     def __str__(self):

File Source/DeadMother.py

 # Please see the file COPYING in this distribution for license information
 import pygame
 import sys # for testing
+import os
 from pygame.color import THECOLORS
 
 import enviro # my global game environment
         
         for i in range (1,9):
             deathFile = filenamePrefix + str(i) + ".png"
-            deathImage = pygame.image.load(deathFile)
-            deathImage.convert()
+            deathImage = pygame.image.load(os.path.join(enviro.artPathHack,deathFile)).convert_alpha()
             self.deathImage.append(deathImage)
             
     def __str__(self):

File Source/GasFactory.py

 # Copyright © 2010 Rob Leachman
 # Please see the file COPYING in this distribution for license information
 #not sure all of these are needed...
-import pygame, random
+import pygame
+import random
+import os
 from pygame.color import THECOLORS
 
 import enviro # my global game environment
         
         pygame.sprite.Sprite.__init__(self)
         self.theImage = image_file
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         self.rect.left = left
         self.rect.top = top
         self.location = 8
         
-        self.need0_white = pygame.image.load(needStuff0_img)
-        self.need0 = pygame.image.load(needMoney0_img)
-        self.need1 = pygame.image.load(needMoney1_img)
-        self.need2 = pygame.image.load(needMoney2_img)
-        self.needStuffToBuild = pygame.image.load(needStuff_img)
-        self.gasFactoryBuilt = pygame.image.load(built_img)
+        self.need0_white = pygame.image.load(os.path.join(enviro.artPathHack,needStuff0_img))
+        self.need0 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney0_img))
+        self.need1 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney1_img))
+        self.need2 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney2_img))
+        self.needStuffToBuild = pygame.image.load(os.path.join(enviro.artPathHack,needStuff_img))
+        self.gasFactoryBuilt = pygame.image.load(os.path.join(enviro.artPathHack,built_img)).convert_alpha()
         self.needCount = 0
         self.needXOffset = 20
         self.needYOffset = 60

File Source/Generator.py

 
 from YourStuff import *
 
-    
-
-  
 class Generator:
     def __init__(self, location, gauges, image_file):
         
         coordX = enviro.getLocationX(location)
         coordY = enviro.getLocationY(location)
         
-        #image = pygame.image.load(image_file).convert()
-        image = pygame.image.load(image_file)
-        #print "Can't convert, it loses alpha..."
+        image = pygame.image.load(os.path.join(enviro.artPathHack,image_file)).convert_alpha()
         enviro.screen.blit(image,[coordX,coordY])
         
         #pygame.draw.rect(enviro.screen, [0,0,200], [coordX+5,coordY+5,80,80],0) # generator
         
         self.genImage = []
         for i in range (1,11):
-            genImg = pygame.image.load("generating-"+str(i)+".png")
+            genImg = pygame.image.load(os.path.join(enviro.artPathHack,"generating-"+str(i)+".png")).convert_alpha()
             self.genImage.append(genImg)
             
         

File Source/Harvester.py

 import Noise
 
 import sys    # for testing
+import os
     
 from AttackerStuff import ShieldSprite
 
 class Harvester:
     def __init__(self, count):
         
-        self.imageEmpty = pygame.image.load("botEmpty.png")
-        self.imageEmpty.convert() # they say this makes it faster...
-        self.imageStuff = pygame.image.load("botWithStuff.png")
-        self.imageStuff.convert()
-        self.imageGas = pygame.image.load("botWithGas.png")
-        self.imageGas.convert()
+        self.imageEmpty = pygame.image.load(os.path.join(enviro.artPathHack,"botEmpty.png")).convert_alpha()
+        self.imageStuff = pygame.image.load(os.path.join(enviro.artPathHack,"botWithStuff.png")).convert_alpha()
+        self.imageGas = pygame.image.load(os.path.join(enviro.artPathHack,"botWithGas.png")).convert_alpha()
         self.rect = self.imageEmpty.get_rect()
         
         self.state = "Returning" # they used to start Idle, now "return" to home

File Source/Laser.py

 # Please see the file COPYING in this distribution for license information
 #not sure all of these are needed...
 import sys
+import os
 import pygame
 from pygame.color import THECOLORS
 
         
         pygame.sprite.Sprite.__init__(self)
         self.theImage = image_file
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         self.location = 11
         

File Source/Shields.py

 # coding=UTF8
 # Copyright © 2010 Rob Leachman
 # Please see the file COPYING in this distribution for license information
-import pygame, random
+import pygame
+import random
+import os
 from pygame.color import THECOLORS
 import sys    # for testing
 from pygame.locals import *
     def __init__(self, image_file, increasing_file, initFuelBays):
         pygame.sprite.Sprite.__init__(self)
         self.theImage = image_file
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         self.location = 10
         
-        self.increasingImage = pygame.image.load(increasing_file)
+        self.increasingImage = pygame.image.load(os.path.join(enviro.artPathHack,increasing_file)).convert_alpha()
         
 ##        self.shieldBlue = []
 ##        self.shieldRed = []

File Source/Title.py

 
 import pygame
 import sys
+import os
 from pygame.locals import *
 
 import enviro
 
         def __init__(self):
             pygame.sprite.Sprite.__init__(self)
-            self.image = pygame.image.load(imageFile).convert()
+            self.image = pygame.image.load(os.path.join(enviro.artPathHack,imageFile)).convert()
             self.rect = self.image.get_rect()
             self.rect.center = (width/2, height/2)
 

File Source/YourStuff.py

         
         pygame.sprite.Sprite.__init__(self)
         self.theImage = image_file
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         self.location = 9
         self.rect.left = x
         
         pygame.sprite.Sprite.__init__(self)
         self.theImage = image_file
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         self.rect.left = left
         self.rect.top = top 
         self.location = 0
         
-        self.need0_white = pygame.image.load(needStuff0_img)
-        self.need0 = pygame.image.load(needMoney0_img)
-        self.need1 = pygame.image.load(needMoney1_img)
-        self.need2 = pygame.image.load(needMoney2_img)
-        self.needStuffToBuild = pygame.image.load(needStuff_img)
-        self.botFactoryBuilt = pygame.image.load(built_img)
+        self.need0_white = pygame.image.load(os.path.join(enviro.artPathHack,needStuff0_img))
+        self.need0 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney0_img))
+        self.need1 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney1_img))
+        self.need2 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney2_img))
+        self.needStuffToBuild = pygame.image.load(os.path.join(enviro.artPathHack,needStuff_img))
+        self.botFactoryBuilt = pygame.image.load(os.path.join(enviro.artPathHack,built_img)).convert_alpha()
         self.needCount = 0
         self.needXOffset = 20
         self.needYOffset = 60        
         
         pygame.sprite.Sprite.__init__(self)
         self.theImage = image_file
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         self.rect.left = left
         self.rect.top = top 
         
         pygame.sprite.Sprite.__init__(self)
         self.theImage = image_file
-        self.image = pygame.image.load(self.theImage)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
         self.rect = self.image.get_rect()
         
     def paint(self, location):
 class Pad(pygame.sprite.Sprite):
     def __init__(self, location, image_file, left, top, needMoney0_img, needMoney1_img, needMoney2_img, needStuff_img):
         pygame.sprite.Sprite.__init__(self)
-        self.image = pygame.image.load(image_file)
+        self.image = pygame.image.load(os.path.join(enviro.artPathHack,image_file)).convert_alpha()
         self.rect = self.image.get_rect()
         self.rect.left = left
         self.rect.top = top
         self.location = location
         
-        self.need0 = pygame.image.load(needMoney0_img)
-        self.need1 = pygame.image.load(needMoney1_img)
-        self.need2 = pygame.image.load(needMoney2_img)
-        self.needStuffToBuild = pygame.image.load(needStuff_img)
+        self.need0 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney0_img)).convert_alpha()
+        self.need1 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney1_img)).convert_alpha()
+        self.need2 = pygame.image.load(os.path.join(enviro.artPathHack,needMoney2_img)).convert_alpha()
+        self.needStuffToBuild = pygame.image.load(os.path.join(enviro.artPathHack,needStuff_img)).convert_alpha()
         self.needCount = 0
         self.needType = "none"
         self.padPainted = False
         self.theImage = image_file_idle
         self.theImageCarrying = image_file_carrying_stuff
         self.theImageCarryingGas = img_carrying_gas
-        self.image = pygame.image.load(self.theImage)
-        self.image_carrying_stuff = pygame.image.load(self.theImageCarrying)
-        self.image_carrying_gas = pygame.image.load(self.theImageCarryingGas)
+        self.image_empty = pygame.image.load(os.path.join(enviro.artPathHack,self.theImage)).convert_alpha()
+        self.image_carrying_stuff = pygame.image.load(os.path.join(enviro.artPathHack,self.theImageCarrying)).convert_alpha()
+        self.image_carrying_gas = pygame.image.load(os.path.join(enviro.artPathHack,self.theImageCarryingGas)).convert_alpha()
+        
+        self.image = self.image_empty
         self.rect = self.image.get_rect()
         
         self.goalX = 3
             if youY + enviro.you.speed[1] > goalY:
                 enviro.you.speed[1] = goalY - youY
                 
+# wow this was awful, even for me!                
+##        if self.carrying == 1:
+##            self.image = pygame.image.load(self.theImageCarrying)
+##        elif self.carrying == 2:
+##            self.image = pygame.image.load(self.theImageCarryingGas)
+##        else:
+##            self.image = pygame.image.load(self.theImage)
+
         if self.carrying == 1:
-            self.image = pygame.image.load(self.theImageCarrying)
+            self.image = self.image_carrying_stuff
         elif self.carrying == 2:
-            self.image = pygame.image.load(self.theImageCarryingGas)
+            self.image = self.image_carrying_gas
         else:
-            self.image = pygame.image.load(self.theImage)
+            self.image = self.image_empty         
+            
         # This worked perfectly, except when the bots collided with you...
         # so now we'll draw the road each time.
         #enviro.screen.blit(enviro.roadImage,self.rect,self.rect)

File Source/enviro.py

 
 import Noise
 
-test = 0
+test = 1
 testMenuSkip = 0
 testEntryScreenSkip = 0
+testing_modules = 0
 
 """ GLOBAL variables """
 """ First some static items we need to run the game:"""
 # I was tearing my hair out before I thought of this easy, horrible solution!
-#artPathHack = os.path.join('..','art')
-#soundPathHack = os.path.join('..','Sound')
-artPathHack = os.path.join('Graphics')
-soundPathHack = os.path.join('Sound')
+if testing_modules:
+    artPathHack = os.path.join('..','Graphics')
+    soundPathHack = os.path.join('..','Sound')
+else: # normal production mode
+    artPathHack = os.path.join('Graphics')
+    soundPathHack = os.path.join('Sound')
 
 screen = 0
 SHIELD_MAX = 2050 # this one is more of a hard-coded thing... determined from shield algorithm
                   (360,140,399,579),
                   (400,540,704,579))
     
-    theRoadImage = pygame.image.load("road3.png").convert_alpha()
+    theRoadImage = pygame.image.load(os.path.join(enviro.artPathHack,"road3.png")).convert_alpha()
     for coord in tileCoords:
         someTile = Tile(theRoadImage, coord[0], coord[1], coord[2], coord[3])
         enviro.tiles.append(someTile) 
     bomb_image = "bomb.png"
     enviro.mother = MotherShip(motherShipFile, fighterFleet, bomb_image)
     
-    enviro.screen.blit(pygame.image.load("effectsIcon.png"), [10,570])
-    enviro.screen.blit(pygame.image.load("musicIcon.png"), [170,570])
+    enviro.screen.blit(pygame.image.load(os.path.join(enviro.artPathHack,"effectsIcon.png")), [10,570])
+    enviro.screen.blit(pygame.image.load(os.path.join(enviro.artPathHack,"musicIcon.png")), [170,570])
 
     paintRoadTiles()
     
         screenDisplaySurface = pygame.display.get_surface()
         enviro.screenCopy = screenDisplaySurface.copy()
         
-        pauseImage = pygame.image.load("pauseInstructions.png").convert()
+        pauseImage = pygame.image.load(os.path.join(enviro.artPathHack,"pauseInstructions.png")).convert()
         enviro.screen.blit(pauseImage,[0,0])
         
 ##        font = pygame.font.Font(None, 20)

File base copy.png

Removed
Old image

File bomb.png

Removed
Old image

File copyright.txt

-# coding=UTF8
-# Copyright © 2010 Rob Leachman
-# Please see the file COPYING in this distribution for license information

File deadBomb1.png

Removed
Old image

File deadBomb2.png

Removed
Old image

File deadBomb3.png

Removed
Old image

File deadBomb4.png

Removed
Old image

File deadFighter10PxA-1.png

Removed
Old image

File deadFighter10PxA-2.png

Removed
Old image

File deadFighter10PxA-3.png

Removed
Old image

File deadFighter10PxA-4.png

Removed
Old image

File deadFighter10PxA-5.png

Removed
Old image

File deadFighter10PxA-6.png

Removed
Old image

File deadFighter10PxA-7.png

Removed
Old image

File deadFighter10PxA-8.png

Removed
Old image

File fuelStore0.png

Removed
Old image

File fuelStore1.png

Removed
Old image

File fuelStore10.png

Removed
Old image

File fuelStore2.png

Removed
Old image

File fuelStore3.png

Removed
Old image

File fuelStore4.png

Removed
Old image

File fuelStore5.png

Removed
Old image

File fuelStore6.png

Removed
Old image

File fuelStore7.png

Removed
Old image

File fuelStore8.png

Removed
Old image

File fuelStore9.png

Removed
Old image

File gas-empty.png

Removed
Old image

File gas-full.png

Removed
Old image

File gas-oneThird.png

Removed
Old image

File gas-twoThirds.png

Removed
Old image

File gasFactory.png

Removed
Old image

File gasFactoryPad.png

Removed
Old image

File generator-produced.png

Removed
Old image

File generator.png

Removed
Old image

File motherDead-1.png

Removed
Old image

File motherDead-2.png

Removed
Old image

File motherDead-3.png

Removed
Old image

File motherDead-4.png

Removed
Old image

File motherDead-5.png

Removed
Old image

File motherDead-6.png

Removed
Old image

File motherDead-7.png

Removed
Old image

File motherDead-8.png

Removed
Old image

File road1.png

Removed
Old image

File road2.png

Removed
Old image

File road3.png

Removed
Old image