コード例 #1
0
    def __init__(self, app, engine, setting):
        super(World, self).__init__(engine, regKeys=True)

        self._applictaion = app
        self._engine = engine
        self._setting = setting
        self._timemanager = engine.getTimeManager()
        self._eventmanager = engine.getEventManager()
        self._model = engine.getModel()
        self._filename = ''
        self._keystate = {
            'UP': False,
            'DOWN': False,
            'LEFT': False,
            'RIGHT': False,
            'CTRL': False,
            'SPACE': False,
        }
        self._pump_ctr = 0
        self._map = None
        self._scene = None
        self._paused = True
        self._pausedtime = 0
        self._starttime = 0

        self._soundmanager = SoundManager(self._engine)

        self._mainmenu = MainMenu(self, self._setting)
        self.showMainMenu()

        self._hudwindow = HeadsUpDisplay(self)
        self._hudwindow.hide()

        self._gameover = GameOverDisplay()
        self._gameover.hide()

        self._highscores = HighScores(self)
        self._highscores.hide()

        self._winner = WinnerDisplay()
        self._winner.hide()

        self._credits = CreditsDisplay(self)
        self._credits.hide()

        self._genericrenderer = None

        self._gamecomplete = False
コード例 #2
0
	def __init__(self, engine):
		super(World, self).__init__(engine, regMouse=True, regKeys=True)
		self.engine = engine
		self.eventmanager = engine.getEventManager()
		self.model = engine.getModel()
		self.filename = ''
		self.pump_ctr = 0 # for testing purposis
		self.ctrldown = False
		self.instancemenu = None
		self.instance_to_agent = {}
		self.dynamic_widgets = {}

		self.light_intensity = 1
		self.light_sources = 0
		self.lightmodel = int(TDS.get("FIFE", "Lighting"))

		self.soundmanager = SoundManager(self.engine)
		self.music = None
コード例 #3
0
ファイル: tactics.py プロジェクト: Niektory/fife_tactics
    def __init__(self, settings):
        print "* Initializing application..."
        super(TacticsApplication, self).__init__(settings)
        self.settings = settings
        self.model = self.engine.getModel()
        self.mapLoader = fife.MapLoader(self.model, self.engine.getVFS(),
                                        self.engine.getImageManager(),
                                        self.engine.getRenderBackend())
        self.objectLoader = fife.ObjectLoader(
            self.model, self.engine.getVFS(), self.engine.getImageManager(),
            self.engine.getAnimationManager())
        self.atlasLoader = fife.AtlasLoader(self.model, self.engine.getVFS(),
                                            self.engine.getImageManager(),
                                            self.engine.getAnimationManager())

        self.map = None
        self.view = None

        self.eventmanager = self.engine.getEventManager()
        self.mouselistener = TacticsMouseListener(self)
        self.keylistener = TacticsKeyListener(self)
        self.eventmanager.addMouseListenerFront(self.mouselistener)
        self.eventmanager.addKeyListenerFront(self.keylistener)
        self.soundmanager = SoundManager(self.engine)
        self.fifesoundmanager = self.engine.getSoundManager()
        print "* Application initialized!"

        self.combat_actions = CombatActions()
        self.gui = TacticsGUI(self)
        self.real_timeline = RealTimeline()
        self.engine.getTimeManager().registerEvent(self.real_timeline)
        self.pather = TacticsPather(self)
        self.engine.getTimeManager().registerEvent(self.pather)

        self.loadObject("objects/tile.xml")
        self.loadObject("objects/boy/object.xml")
        self.loadObject("objects/dot_red.xml")
        self.loadObject("objects/shadow.xml")
        self.loadObject("objects/effects/fire.xml")
        self.loadObject("objects/effects/explosion.xml")
        self.loadObject("objects/effects/freeze.xml")
        self.loadObject("objects/projectiles/stone.xml")
        self.loadObject("objects/projectiles/fireball.xml")
        self.loadObject("objects/projectiles/tarball.xml")
        self.loadAtlas("objects/nature.xml")
        self.loadObject("objects/caltrops.xml")
        self.loadObject("objects/tar.xml")
        self.loadObject("objects/ice.xml")
        self.loadObject("objects/water_under.xml")
        self.loadObject("objects/water.xml")
        self.loadObject("objects/block_gray.xml")
        self.loadObject("objects/block_grass.xml")

        self.music = self.soundmanager.createSoundEmitter("music/music1.ogg")
        self.sound_attack = self.soundmanager.createSoundEmitter(
            "sfx/attack-1.ogg")
        self.sound_fire = self.soundmanager.createSoundEmitter(
            "sfx/fire-1.ogg")
        self.music.looping = True
        if not self.settings.get("FIFE", "PlaySounds"):
            self.fifesoundmanager.setVolume(0.0)
        self.music.play()

        self.unloadMap()
コード例 #4
0
ファイル: application.py プロジェクト: skangas/zombieswtf
    def __init__(self):
        super(ZombiesWTF, self).__init__(TDS)
        self.world = world.World(self.engine)
        self.listener = ApplicationListener(self.engine, self.world)

        self.soundmanager = SoundManager(self.engine)