예제 #1
0
fife_path = os.path.join('..','..','engine','python')
if os.path.isdir(fife_path) and fife_path not in sys.path:
	sys.path.insert(0,fife_path)

from fife import fife
print("Using the FIFE python module found here: ", os.path.dirname(fife.__file__))

from fife.extensions import *
from scripts import world
from scripts.common import eventlistenerbase
from fife.extensions import pychan
from fife.extensions.pychan.pychanbasicapplication import PychanApplicationBase
from fife.extensions.pychan import widgets
from fife.extensions.pychan.fife_pychansettings import FifePychanSettings

TDS = FifePychanSettings(app_name="shooter", 
              settings_file="./settings.xml")
              
TDS.setAvailableScreenResolutions(["1024x768"])

class ApplicationListener(eventlistenerbase.EventListenerBase):
	def __init__(self, engine, world):
		super(ApplicationListener, self).__init__(engine,regKeys=True,regCmd=True, regMouse=False, regConsole=True, regWidget=True)
		self._engine = engine
		self._world = world
		self._quit = False
		
	def keyPressed(self, evt):
		keyval = evt.getKey().getValue()
		keystr = evt.getKey().getAsString().lower()
		consumed = False
		if keyval == fife.Key.ESCAPE:
예제 #2
0
# ####################################################################

import sys, os, re, math, random, shutil

fife_path = os.path.join('..', '..', 'engine', 'python')
if os.path.isdir(fife_path) and fife_path not in sys.path:
    sys.path.insert(0, fife_path)

from fife import fife
print "Using the FIFE python module found here: ", os.path.dirname(
    fife.__file__)

from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
from scripts.rpg import RPGApplication

TDS = FifePychanSettings(app_name="rpg", settings_file="./settings.xml")


def main():
    app = RPGApplication(TDS)
    app.run()


if __name__ == '__main__':
    if TDS.get("FIFE", "ProfilingOn"):
        import hotshot, hotshot.stats
        print "Starting profiler"
        prof = hotshot.Profile("fife.prof")
        prof.runcall(main)
        prof.close()
        print "analysing profiling results"
예제 #3
0
파일: run.py 프로젝트: lynxis/fifengine
from fife import fife
print "Using the FIFE python module found here: ", os.path.dirname(
    fife.__file__)

from fife.extensions import *
from scripts import world
from scripts.common import eventlistenerbase
from fife.extensions import pychan
from fife.extensions.pychan.pychanbasicapplication import PychanApplicationBase
from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
from fife.extensions.pychan import widgets
from fife.extensions.pychan.internal import get_manager
from fife.extensions.fife_settings import Setting
from fife.extensions.fife_utils import getUserDataDirectory

TDS = FifePychanSettings(app_name="rio_de_hola")


class ApplicationListener(eventlistenerbase.EventListenerBase):
    def __init__(self, engine, world):
        super(ApplicationListener, self).__init__(engine,
                                                  regKeys=True,
                                                  regCmd=True,
                                                  regMouse=False,
                                                  regConsole=True,
                                                  regWidget=True)
        self.engine = engine
        self.world = world
        engine.getEventManager().setNonConsumableKeys([
            fife.Key.ESCAPE,
        ])
예제 #4
0
from fife import fife
print("Using the FIFE python module found here: ", os.path.dirname(fife.__file__))

from fife.extensions import *
from scripts import world
from scripts.common import eventlistenerbase
from fife.extensions import pychan
from fife.extensions.pychan.pychanbasicapplication import PychanApplicationBase
from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
from fife.extensions.pychan import widgets
from fife.extensions.pychan.internal import get_manager
from fife.extensions.fife_settings import Setting
from fife.extensions.fife_utils import getUserDataDirectory

TDS = FifePychanSettings(app_name="rio_de_hola")

class KeyFilter(fife.IKeyFilter):
	"""
	This is the implementation of the fife.IKeyFilter class.

	Prevents any filtered keys from being consumed by fifechan.
	"""
	def __init__(self, keys):
		fife.IKeyFilter.__init__(self)
		self._keys = keys

	def isFiltered(self, event):
		return event.getKey().getValue() in self._keys

class ApplicationListener(eventlistenerbase.EventListenerBase):
예제 #5
0
if os.path.isdir(fife_path) and fife_path not in sys.path:
    sys.path.insert(0, fife_path)

from fife import fife
print("Using the FIFE python module found here: ",
      os.path.dirname(fife.__file__))

from fife.extensions import *
from scripts import world
from scripts.common import eventlistenerbase
from fife.extensions import pychan
from fife.extensions.pychan.pychanbasicapplication import PychanApplicationBase
from fife.extensions.pychan import widgets
from fife.extensions.pychan.fife_pychansettings import FifePychanSettings

TDS = FifePychanSettings(app_name="shooter", settings_file="./settings.xml")

TDS.setAvailableScreenResolutions(["1024x768"])


class ApplicationListener(eventlistenerbase.EventListenerBase):
    def __init__(self, engine, world):
        super(ApplicationListener, self).__init__(engine,
                                                  regKeys=True,
                                                  regCmd=True,
                                                  regMouse=False,
                                                  regConsole=True,
                                                  regWidget=True)
        self._engine = engine
        self._world = world
        self._quit = False
예제 #6
0
파일: run.py 프로젝트: LilMouse/fifengine
# ####################################################################

import sys, os, re, math, random, shutil

fife_path = os.path.join('..','..','engine','python')
if os.path.isdir(fife_path) and fife_path not in sys.path:
	sys.path.insert(0,fife_path)

from fife import fife
print "Using the FIFE python module found here: ", os.path.dirname(fife.__file__)

from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
from scripts.rpg import RPGApplication


TDS = FifePychanSettings(app_name="rpg",
              settings_file="./settings.xml")


def main():
	app = RPGApplication(TDS)
	app.run()

if __name__ == '__main__':
	if TDS.get("FIFE", "ProfilingOn"):
		import hotshot, hotshot.stats
		print "Starting profiler"
		prof = hotshot.Profile("fife.prof")
		prof.runcall(main)
		prof.close()
		print "analysing profiling results"
		stats = hotshot.stats.load("fife.prof")
예제 #7
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2018 Tomasz "Niektóry" Turowski

#from traceback import print_exc

from scripts.error import LogException

if __name__ == '__main__':
    with LogException():
        from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
        from scripts.application import Application
        settings = FifePychanSettings(app_name="touhouwolves",
                                      settings_file="./settings.xml",
                                      settings_gui_xml="")
        application = Application(settings)
        application.run()
예제 #8
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2017 Tomasz "Niektóry" Turowski

#from traceback import print_exc

from scripts.error import LogException

if __name__ == '__main__':
    with LogException():
        from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
        from scripts.application import Application
        settings = FifePychanSettings(app_name="steamfolktales",
                                      settings_file="./settings.xml",
                                      settings_gui_xml="")
        application = Application(settings)
        application.run()
예제 #9
0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright 2017 Tomasz "Niektóry" Turowski

from scripts.error import LogException

if __name__ == '__main__':
    with LogException():
        from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
        from scripts.tactics import TacticsApplication
        settings = FifePychanSettings(app_name="fife_tactics",
                                      settings_file="./settings.xml",
                                      settings_gui_xml="")
        application = TacticsApplication(settings)
        application.run()