annotate eosd @ 336:72ef7e24b373

Fix MSG skipping.
author Thibaut Girka <thib@sitedethib.com>
date Sun, 01 Jul 2012 18:06:11 +0200
parents 4eca6130f118
children bc162f60f0a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
1 #!/usr/bin/env python
52
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
2 # -*- encoding: utf-8 -*-
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
3 ##
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
4 ## Copyright (C) 2011 Thibaut Girka <thib@sitedethib.com>
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
5 ##
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
6 ## This program is free software; you can redistribute it and/or modify
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
7 ## it under the terms of the GNU General Public License as published
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
8 ## by the Free Software Foundation; version 3 only.
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
9 ##
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
10 ## This program is distributed in the hope that it will be useful,
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
13 ## GNU General Public License for more details.
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 50
diff changeset
14 ##
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
15
186
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
16 import argparse
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
17 import os
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
18
131
fab7ad2f0d8b Use Cython, improve performances!
Thibaut Girka <thib@sitedethib.com>
parents: 130
diff changeset
19 import pyximport
fab7ad2f0d8b Use Cython, improve performances!
Thibaut Girka <thib@sitedethib.com>
parents: 130
diff changeset
20 pyximport.install()
fab7ad2f0d8b Use Cython, improve performances!
Thibaut Girka <thib@sitedethib.com>
parents: 130
diff changeset
21
97
ac2e5e1c2c3c Refactor \o/
Thibaut Girka <thib@sitedethib.com>
parents: 94
diff changeset
22 from pytouhou.resource.loader import Loader
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
23 from pytouhou.game.background import Background
205
ee6dfd14a785 Rename pytouhou.opengl to pytouhou.ui, makes much more sense that way.
Thibaut Girka <thib@sitedethib.com>
parents: 196
diff changeset
24 from pytouhou.ui.gamerunner import GameRunner
196
1e501e3b6645 Add a subclass for each character, and implement player attacks.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 188
diff changeset
25 from pytouhou.games.eosd import EoSDGame
130
11ab06f4c4c6 Introduce characters!
Thibaut Girka <thib@sitedethib.com>
parents: 122
diff changeset
26 from pytouhou.game.player import PlayerState
187
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
27 from pytouhou.formats.t6rp import T6RP
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
28 from pytouhou.utils.random import Random
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
29 from pytouhou.vm.msgrunner import NextStage
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
30
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
31
332
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
32 class EoSDGameBossRush(EoSDGame):
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
33 def run_iter(self, keystate):
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
34 for i in range(16):
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
35 EoSDGame.run_iter(self, keystate if i == 0 else 0)
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
36 if (self.msg_wait or self.enemies or self.items
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
37 or self.lasers or self.bullets or self.cancelled_bullets):
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
38 break
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
39
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
40 def cleanup(self):
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
41 if not (self.boss or self.msg_wait or self.ecl_runner.boss_wait):
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
42 self.enemies = [enemy for enemy in self.enemies
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
43 if enemy.boss_callback != -1 or enemy.frame > 1]
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
44 self.lasers = [laser for laser in self.lasers if laser.frame > 1]
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
45 self.bullets = [bullet for bullet in self.bullets if bullet.frame > 1]
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
46 self.players_lasers = [(laser if laser and laser.frame > 1 else None) for laser in self.players_lasers]
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
47 self.players_bullets = [bullet for bullet in self.players_bullets if bullet.frame > 1]
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
48 EoSDGame.cleanup(self)
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
49
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
50
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
51
334
4eca6130f118 Add options to set FPS limit and disable double buffering
Thibaut Girka <thib@sitedethib.com>
parents: 333
diff changeset
52 def main(path, data, stage_num, rank, character, replay, boss_rush, fps_limit, single_buffer):
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
53 resource_loader = Loader(path)
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
54 resource_loader.scan_archives(data)
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
55
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
56 if stage_num is None:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
57 story = True
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
58 stage_num = 1
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
59 else:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
60 story = False
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
61
187
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
62 if replay:
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
63 with open(replay, 'rb') as file:
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
64 replay = T6RP.read(file)
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
65 rank = replay.rank
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
66 character = replay.character
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
67
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
68 difficulty = 16
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
69 default_power = [0, 64, 128, 128, 128, 128, 0][stage_num - 1]
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
70 states = [PlayerState(character=character, power=default_power)]
187
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
71
332
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
72 game_class = EoSDGameBossRush if boss_rush else EoSDGame
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
73
334
4eca6130f118 Add options to set FPS limit and disable double buffering
Thibaut Girka <thib@sitedethib.com>
parents: 333
diff changeset
74 runner = GameRunner(resource_loader, fps_limit=fps_limit, double_buffer=(not single_buffer))
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
75 while True:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
76 if replay:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
77 level = replay.levels[stage_num - 1]
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
78 if not level:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
79 raise Exception
262
8fa660da5f0c Automatically search data files using different names.
Thibaut Girka <thib@sitedethib.com>
parents: 231
diff changeset
80
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
81 prng = Random(level.random_seed)
83
fc0294c745b6 Basic bullet handling! Clean up as soon as possible :p
Thibaut Girka <thib@sitedethib.com>
parents: 72
diff changeset
82
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
83 #TODO: apply the replay to the other players.
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
84 #TODO: see if the stored score is used or if it’s the one from the previous stage.
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
85 if stage_num != 1 and stage_num - 2 in replay.levels:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
86 previous_level = replay.levels[stage_num - 1]
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
87 states[0].score = previous_level.score
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
88 states[0].effective_score = previous_level.score
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
89 states[0].power = level.power
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
90 states[0].lives = level.lives
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
91 states[0].bombs = level.bombs
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
92 difficulty = level.difficulty
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
93 else:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
94 prng = None
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
95
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
96 # Load stage data
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
97 stage = resource_loader.get_stage('stage%d.std' % stage_num)
321
61adb5453e46 Implement music playback.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 300
diff changeset
98
332
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
99 game = game_class(resource_loader, states, stage_num, rank, difficulty, prng=prng, bgms=stage.bgms)
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
100
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
101 background_anm_wrapper = resource_loader.get_anm_wrapper(('stg%dbg.anm' % stage_num,))
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
102 background = Background(stage, background_anm_wrapper)
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
103
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
104 # Main loop
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
105 runner.load_game(game, background, replay)
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
106 try:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
107 runner.start()
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
108 break
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
109 except NextStage:
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
110 game.music.pause()
333
d369a369204a Prevent story mode in easy to go beyond stage 5.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 332
diff changeset
111 if not story or stage_num == (7 if boss_rush else 6 if rank > 0 else 5):
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
112 break
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
113 stage_num += 1
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
114 states = [player.state.copy() for player in game.players] # if player.state.lives >= 0]
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
115
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
116
297
a09ac4650e0d Fix relative path handling and os-specific path separators.
Thibaut Girka <thib@sitedethib.com>
parents: 265
diff changeset
117 pathsep = os.path.pathsep
a09ac4650e0d Fix relative path handling and os-specific path separators.
Thibaut Girka <thib@sitedethib.com>
parents: 265
diff changeset
118 default_data = (pathsep.join(('CM.DAT', 'th06*_CM.DAT', '*CM.DAT', '*cm.dat')),
a09ac4650e0d Fix relative path handling and os-specific path separators.
Thibaut Girka <thib@sitedethib.com>
parents: 265
diff changeset
119 pathsep.join(('ST.DAT', 'th6*ST.DAT', '*ST.DAT', '*st.dat')),
300
da53bc29b94a Add the game interface.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 297
diff changeset
120 pathsep.join(('IN.DAT', 'th6*IN.DAT', '*IN.DAT', '*in.dat')),
321
61adb5453e46 Implement music playback.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 300
diff changeset
121 pathsep.join(('MD.DAT', 'th6*MD.DAT', '*MD.DAT', '*md.dat')),
297
a09ac4650e0d Fix relative path handling and os-specific path separators.
Thibaut Girka <thib@sitedethib.com>
parents: 265
diff changeset
122 pathsep.join(('102h.exe', '102*.exe', '東方紅魔郷.exe', '*.exe')))
262
8fa660da5f0c Automatically search data files using different names.
Thibaut Girka <thib@sitedethib.com>
parents: 231
diff changeset
123
8fa660da5f0c Automatically search data files using different names.
Thibaut Girka <thib@sitedethib.com>
parents: 231
diff changeset
124
186
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
125 parser = argparse.ArgumentParser(description='Libre reimplementation of the Touhou 6 engine.')
18
ca26a84916cb Add preliminary ECL viewer/interpreter.
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
126
262
8fa660da5f0c Automatically search data files using different names.
Thibaut Girka <thib@sitedethib.com>
parents: 231
diff changeset
127 parser.add_argument('data', metavar='DAT', default=default_data, nargs='*', help='Game’s data files')
186
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
128 parser.add_argument('-p', '--path', metavar='DIRECTORY', default='.', help='Game directory path.')
331
1b4f04b08729 Add the story mode.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 321
diff changeset
129 parser.add_argument('-s', '--stage', metavar='STAGE', type=int, default=None, help='Stage, 1 to 7 (Extra).')
186
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
130 parser.add_argument('-r', '--rank', metavar='RANK', type=int, default=0, help='Rank, from 0 (Easy, default) to 3 (Lunatic).')
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
131 parser.add_argument('-c', '--character', metavar='CHARACTER', type=int, default=0, help='Select the character to use, from 0 (ReimuA, default) to 3 (MarisaB).')
187
46793ccfedca Implement replays.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 186
diff changeset
132 parser.add_argument('--replay', metavar='REPLAY', help='Select a replay')
332
bdcf2077e368 Add a boss rush mode
Thibaut Girka <thib@sitedethib.com>
parents: 331
diff changeset
133 parser.add_argument('-b', '--boss-rush', action='store_true', help='Fight only bosses')
334
4eca6130f118 Add options to set FPS limit and disable double buffering
Thibaut Girka <thib@sitedethib.com>
parents: 333
diff changeset
134 parser.add_argument('--single-buffer', action='store_true', help='Disable double buffering')
4eca6130f118 Add options to set FPS limit and disable double buffering
Thibaut Girka <thib@sitedethib.com>
parents: 333
diff changeset
135 parser.add_argument('--fps-limit', metavar='FPS', default=60, type=int, help='Set fps limit')
186
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
136
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
137 args = parser.parse_args()
84da28ae7ee4 Parse command line with argparse.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 162
diff changeset
138
334
4eca6130f118 Add options to set FPS limit and disable double buffering
Thibaut Girka <thib@sitedethib.com>
parents: 333
diff changeset
139 main(args.path, tuple(args.data), args.stage, args.rank, args.character,
4eca6130f118 Add options to set FPS limit and disable double buffering
Thibaut Girka <thib@sitedethib.com>
parents: 333
diff changeset
140 args.replay, args.boss_rush, args.fps_limit, args.single_buffer)