def __init__(self): Controller.__init__(self) pygame.mixer.init() resource = Resource() self.config = Config() self.musicOn = False self.effects = { "bubble": resource.audio("bubble.wav"), "click": resource.audio("click.wav"), "delete":resource.audio("delete.wav"), } self.bgSound = resource.audio("bg.wav", music=True) self.bind(CellAddedEvent(), self.onCellAddedDoBubble) self.bind(CellRemovedEvent(), self.onCellRemovedDoDelete) self.bind(PauseEvent(), self.onPauseDoClick) self.bind(GameStartEvent(), self.onGameStartDoBackground)
def nextGeneration(self): lib = Resource().dll("game_of_life_algorithm") lib.nextGeneration(self.grid, self.gridSize[0], self.gridSize[1])
def __init__(self, screen): View.__init__(self, screen) resource = Resource() self.cell = resource.image("cell", True) self.background = resource.image("bg", True)
along with this program. If not, see <http://www.gnu.org/licenses/>. """ __author__ = "Rubens Pinheiro Gonçalves Cavalcante" __date__ = "08/05/13 19:18" __licence__ = "GPLv3" __email__ = "*****@*****.**" import sys from core.resource_manager import Resource from core.config import Config if __name__ == "__main__": if "--genimg" in sys.argv: resource = Resource() resource.generateSprites() elif "--genqrc" in sys.argv: resource = Resource() resource.generateQrcFile() elif "--version" in sys.argv: conf = Config() print conf.attr.game.version elif "--help" in sys.argv: print "Usage: run-pygameoflife <commands>\n\nCommands:" print "'genimg' generates the images used in application from sources" print "'--version' show the game version" print "'--help' show this help\n"
def __init__(self, screen): View.__init__(self, screen) resource = Resource() self.config = Config() self.background = resource.image("bg", True)