コード例 #1
0
ファイル: ransack.py プロジェクト: dusty141/ransack-python
 def __init__(self):
     self.myHero = hero.hero()
     self.myMenu = menu.menu()
     self.myMap = None
     self.levelDepth = 2
     # a dungeon is just an array of maps
     self.myDungeon = []
     for mapFileName in mapList:
         self.myDungeon += [map.map(mapFileName)]
     
     self.myMap = self.myDungeon[self.levelDepth]
     
     self.allsprites = pygame.sprite.RenderPlain((self.myHero))
     
     #this is true while player is in a particular game
     self.gameOn = True
     
     #this is true while player is in a particular level
     self.levelOn = True        
     
     self.gameBoard = pygame.Surface( [450,450] )
     self.gameFrame, self.gameFrameRect = load_image('gamescreen600.bmp', -1)
     
     self.DIM = DIM
     
     # 0 : camera
     # 1 : sword
     # 2 : miss
     self.sounds = range(3)
     self.sounds[0] = pygame.mixer.Sound(os.path.join('SND', 'camera.wav' ))
     self.sounds[1] = pygame.mixer.Sound(os.path.join('SND', 'sword1.wav' ))
     self.sounds[2] = pygame.mixer.Sound(os.path.join('SND', 'miss.wav' ))
     
     self.myHud = hud.hud(screen, self)
     self.myBattle = battle.battle(screen,self.myHud)
コード例 #2
0
ファイル: ransack.py プロジェクト: dusty141/ransack-python
 def generateMap(self, dimension):
     rndMap = mapgen.Map(dimension)
     rndMap.generateMap(20)
     newMap = map.map(None, rndMap.getMapBall())
     return newMap