Changeset 44

Show
Ignore:
Timestamp:
02/18/2012 04:33:39 PM (2 years ago)
Author:
mmorton
Message:

Did awesome shit! It was awesome... We're obviously the better half of the team... just saying. If the other half tried as hard as they could they couldn't possibly catch up to us in a million years.

Files:
1 removed
4 modified

Legend:

Unmodified
Added
Removed
  • src/buildables.py

    r43 r44  
    99from building import * 
    1010from buildingStats import * 
     11import os 
    1112 
    1213# Building Look Up Table 
    1314buildingLUT = {} 
    1415 
    15 # Example 
     16################################# Train ################################### 
    1617trainStats = BuildingStats() 
    1718trainStats.setInit(Spec(100,20,0,-10,0)) 
    1819trainStats.setCont(Spec(0,0,10,0,5)) 
    19  
    2020train = Building('train', TRANSPORT, trainStats) 
    2121train.setMenuDescript("This is a train") 
     
    2525buildingLUT['train'] = train 
    2626 
     27################################# Plane ################################### 
     28planeStats = BuildingStats() 
     29planeStats.setInit(Spec(100,20,0,-10,0)) 
     30planeStats.setCont(Spec(0,0,10,0,5)) 
     31plane = Building('plane', TRANSPORT, planeStats) 
     32plane.setMenuDescript("This is a plane") 
     33plane.setDetailedDescript("This is a detailed description of a plane.") 
     34plane.setImageFileName("png" + os.sep +"plane.png") 
     35 
     36buildingLUT['plane'] = plane 
     37 
  • src/image.py

    r17 r44  
    1010class Image: 
    1111    def __init__(self, pos, width, height, image): 
    12         self.image = image 
     12        self.image = pygame.transform.smoothscale(image,(width,height)) 
    1313        self.pos = (self.left,self.top) = pos 
    1414        self.width = width 
     
    1616         
    1717    def render(self,surface): 
    18         imageSurface = pygame.transform.smoothscale(self.image,(self.width,self.height)) 
    19         surface.blit(imageSurface,pygame.Rect(self.left,self.top,self.width,self.height)) 
     18        #imageSurface = pygame.transform.smoothscale(self.image,(self.width,self.height)) 
     19        surface.blit(self.image,pygame.Rect(self.left,self.top,self.width,self.height)) 
    2020         
    2121    def getRect(self): 
  • src/turn.py

    r43 r44  
    1919        if windowType[0] == 'create' : 
    2020            self.currentState.addBuilding(windowType[1]) 
     21            return self.turnMenu.createBuildMenu(self.currentState) 
    2122     
    2223    def getState(self): 
  • src/turnMenu.py

    r43 r44  
    2323        buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + "menu_icons" + os.sep + "png" + os.sep + "build.png")) 
    2424        buildIcon = WindowEntry(('',False,False)) 
    25         #buildIcon.addImage(Image((120,10),40,40,buildArt)) 
    26         #buildIcon.addImage(Image((345,10),40,40,buildArt)) 
     25        buildIcon.addImage(Image((120,10),40,40,buildArt)) 
     26        buildIcon.addImage(Image((345,10),40,40,buildArt)) 
    2727        buildIcon.addRectangle(Rectangle((0,0),MENU_W,MENU_H,BLUE)) 
    2828        buildIcon.addText(Text((210,17),"BUILD",42,WHITE,)) 
     
    3434            buildIcon = WindowEntry(('describe_' + name,False,False)) 
    3535            buildArt = pygame.image.load(os.path.abspath(resourceDir + os.sep + 'menu_icons' + os.sep + buildingLUT[name].imageFileName)) 
    36             #buildIcon.addImage(Image((390,110+ENTRY_SHIFT*i),ICON_SIZE,ICON_SIZE,buildArt)) 
     36            buildIcon.addImage(Image((390,110+ENTRY_SHIFT*i),ICON_SIZE,ICON_SIZE,buildArt)) 
    3737            buildIcon.addRectangle(Rectangle((20,100+ENTRY_SHIFT*i),460,100,CYAN)) 
    3838            buildIcon.addText(Text((25,110+ENTRY_SHIFT*i),name,32,WHITE))