Esempio n. 1
0
def main():
    """Application code starts from here"""
    if not main_is_frozen():
        version = loadSettings().get("PARPG", "SettingsVersion")
        dist_version = loadSettings("./settings-dist.xml").get("PARPG", "SettingsVersion")
        if (version != dist_version):
            print "Newer settings-dist.xml found, renaming settings.xml to settings-old.xml"
            shutil.copyfile('./settings.xml', './settings-old.xml')
            shutil.copyfile('./settings-dist.xml', './settings.xml')
    app = PARPGApplication(loadSettings())
    app.run()
Esempio n. 2
0
    if main_is_frozen():
        return os.path.dirname(sys.executable)
    return os.path.dirname(sys.argv[0])


def main():
    """Application code starts from here"""
    if not main_is_frozen():
        version = loadSettings().get("PARPG", "SettingsVersion")
        dist_version = loadSettings("./settings-dist.xml").get("PARPG", "SettingsVersion")
        if (version != dist_version):
            print "Newer settings-dist.xml found, renaming settings.xml to settings-old.xml"
            shutil.copyfile('./settings.xml', './settings-old.xml')
            shutil.copyfile('./settings-dist.xml', './settings.xml')
    app = PARPGApplication(loadSettings())
    app.run()

if __name__ == '__main__':
    if loadSettings().get("FIFE", "UsePsyco"):
        # Import Psyco if available
        try:
            import psyco
            psyco.full()
            print "Psyco acceleration in use"
        except ImportError:
            print "Psyco acceleration not used"
    else:
        print "Psyco acceleration not used"
    main()

Esempio n. 3
0
from random import randrange


from fife import fife

from base import GameObject, Living, Scriptable, CharStats
from composed import CarryableItem
from scripts.inventory import Inventory
from scripts.common.utils import loadSettings

"""All actors go here. Concrete classes only."""

__all__ = ["PlayerCharacter", "NonPlayerCharacter"]

Settings = loadSettings()

_AGENT_STATE_NONE, _AGENT_STATE_IDLE, _AGENT_STATE_APPROACH, _AGENT_STATE_RUN, _AGENT_STATE_WANDER, _AGENT_STATE_TALK = xrange(
    6
)


class ActorBehaviour(fife.InstanceActionListener):
    """Fife agent listener"""

    def __init__(self, layer):
        fife.InstanceActionListener.__init__(self)
        self.layer = layer
        self.agent = None
        self.state = None
        self.speed = 0