source: trunk/game/run.py @ 609

Revision 609, 1.9 KB checked in by beliar, 9 years ago (diff)

Patch by Beliar.

  • Removed item_id from CarryableItem?.
  • item_type of CarryableItem? now store store the actual type of the item instead of the python class
  • Changed functions that find items by item_id to find items by item_type instead.
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2
3#   This program is free software: you can redistribute it and/or modify
4#   it under the terms of the GNU General Public License as published by
5#   the Free Software Foundation, either version 3 of the License, or
6#   (at your option) any later version.
7
8#   This program is distributed in the hope that it will be useful,
9#   but WITHOUT ANY WARRANTY; without even the implied warranty of
10#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#   GNU General Public License for more details.
12
13#   You should have received a copy of the GNU General Public License
14#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16import os
17from scripts.common import utils
18
19from fife import fife
20print "Using the FIFE python module found here: ", \
21    os.path.dirname(fife.__file__)
22from fife.extensions.fife_settings import Setting
23from scripts.parpg import PARPGApplication
24
25# add paths to the swig extensions
26utils.addPaths ('../../engine/swigwrappers/python', '../../engine/extensions')
27utils.addPaths ('./lib', './lib/extensions')
28
29
30TDS = Setting(app_name="PARPG",
31              settings_file="./settings.xml", 
32              settings_gui_xml="")
33
34"""This folder holds the main meta-data for PARPG. This file should be
35   minimal, since folding code into the controller with MVC is usually bad
36   All game and logic and data is held held and referenced in
37   /scripts/engine.py. All fife stuff goes in /scripts/world.py"""
38
39def main():
40    """Application code starts from here"""
41    app = PARPGApplication(TDS)
42    app.run()
43
44if __name__ == '__main__':
45    if TDS.get("FIFE", "UsePsyco"):
46        # Import Psyco if available
47        try:
48            import psyco
49            psyco.full()
50            print "Psyco acceleration in use"
51        except ImportError:
52            print "Psyco acceleration not used"
53    else:
54        print "Psyco acceleration not used"
55    main()
56
Note: See TracBrowser for help on using the repository browser.