def __init__(self): Application.__init__(self) # Create player and put it in a spritegroup self.player = Player() self.playerGroup = pygame.sprite.GroupSingle(self.player) # Create the PlayerController and pass it player and add a keyboard listener to it self.pc = PlayerController(self.player) self.input.add_key_listener(self.pc) #Create Hud instance self.gameHud = Hud(self.player.health,self.hud) #Level change variable(s??) self.changing = False self.timer = 0 self.check = False self.fadeAlpha = 255 #self.fadeScreen = Surface(self.gameArea.get_size()) #self.fadeScreen.fill((0,0,0)) #self.fadeScreen.set_alpha(0) # Create the sound effects controller and give it a keyboard listener as well sc = SfxController(self.sounds, self) self.input.add_key_listener(sc) # Load the tilemap image, build a tilesheet out of it and render the tilesheet into an image which we can blit to the screen self.levels = [] self.img_tiles = load_image(TILEMAP_IMAGE, (0,255,200)) self.tileSheet = TileSheet(self.img_tiles, (TILE_SIZE)) # Create an array of all the levels index = 0 for levelFile in LEVELS: self.levels.append(Level(levelFile, self.tileSheet, index)) index += 1 self.currLevel = self.levels[0] self.count = 0 #Camera init self.cam = Camera(self.player,self.currLevel.bounds,self.gameArea.get_size())