This repository has been archived by the owner on Sep 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
nodereviver.py
executable file
·65 lines (57 loc) · 2.63 KB
/
nodereviver.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/python
'''
This file is part of nodereviver
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@author: Vincent Petry <[email protected]>
'''
from nodereviver.config import Config
import optparse
def main():
config = Config()
parser = optparse.OptionParser(description='Node Reviver')
parser.add_option('--disable-sound', action="store_true",
dest='disableSound',
default=False, help='disable sound')
parser.add_option('--game', action="store_true", default=True,
dest='game',
help='runs the game (default)')
parser.add_option('--editor', action="store_true", default=False,
dest='editor',
help='runs the level editor (buggy)')
parser.add_option('--fullscreen', action="store_true", default=config.fullScreen,
dest='fullScreen',
help='runs the game in full screen mode')
parser.add_option('--startlevel', action="store", default=1,
dest='startLevel', type=int,
help='specifies the start level number (cheat mode)')
parser.add_option('--datapath', action="store", default=config.dataPath,
dest='dataPath', type=str,
help='specifies the data path')
parser.add_option('--controls', action="store_true", default=config.controls,
dest='controls',
help='Displays UI buttons (suitable for touch screens)')
(args, rest) = parser.parse_args()
config.startLevel = args.startLevel
config.sound = not args.disableSound
config.dataPath = args.dataPath
config.fullScreen = args.fullScreen
config.controls = args.controls
if args.editor:
from nodereviver.editor import Editor
editor = Editor(config)
editor.run()
elif args.game:
from nodereviver.game import Game
game = Game(config)
game.run()
if __name__ == '__main__':
main()