comparison pytouhou/game/game.py @ 372:704bea2e4360

Use a future-proof ECL parser.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 06 Aug 2012 22:52:22 +0200
parents 488c094ed51d
children 6deab6ad8be8
comparison
equal deleted inserted replaced
371:6702bc0215dc 372:704bea2e4360
77 77
78 self.enm_anm_wrapper = resource_loader.get_anm_wrapper2(('stg%denm.anm' % stage, 78 self.enm_anm_wrapper = resource_loader.get_anm_wrapper2(('stg%denm.anm' % stage,
79 'stg%denm2.anm' % stage)) 79 'stg%denm2.anm' % stage))
80 self.etama4 = resource_loader.get_anm_wrapper(('etama4.anm',)) 80 self.etama4 = resource_loader.get_anm_wrapper(('etama4.anm',))
81 ecl = resource_loader.get_ecl('ecldata%d.ecl' % stage) 81 ecl = resource_loader.get_ecl('ecldata%d.ecl' % stage)
82 self.ecl_runner = ECLMainRunner(ecl, self) 82 self.ecl_runners = [ECLMainRunner(main, ecl.subs, self) for main in ecl.mains]
83 83
84 self.spellcard_effect_anm_wrapper = resource_loader.get_anm_wrapper(('eff0%d.anm' % stage,)) 84 self.spellcard_effect_anm_wrapper = resource_loader.get_anm_wrapper(('eff0%d.anm' % stage,))
85 self.spellcard_effect = None 85 self.spellcard_effect = None
86 86
87 #TODO: better place? 87 #TODO: better place?
213 return label 213 return label
214 214
215 215
216 def run_iter(self, keystate): 216 def run_iter(self, keystate):
217 # 1. VMs. 217 # 1. VMs.
218 self.ecl_runner.run_iter() 218 for runner in self.ecl_runners:
219 runner.run_iter()
219 220
220 # 2. Modify difficulty 221 # 2. Modify difficulty
221 if self.frame % (32*60) == (32*60): #TODO: check if that is really that frame. 222 if self.frame % (32*60) == (32*60): #TODO: check if that is really that frame.
222 self.modify_difficulty(+100) 223 self.modify_difficulty(+100)
223 224