Mercurial > touhou
comparison pytouhou/game/game.py @ 341:61caded6b4f5
Clean music playback API a little.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 04 Jul 2012 23:05:21 +0200 |
parents | 7a05edbab88a |
children | 94fdb6c782c1 |
comparison
equal
deleted
inserted
replaced
340:39bc59953dfa | 341:61caded6b4f5 |
---|---|
114 self.difficulty = self.difficulty_min | 114 self.difficulty = self.difficulty_min |
115 elif self.difficulty > self.difficulty_max: | 115 elif self.difficulty > self.difficulty_max: |
116 self.difficulty = self.difficulty_max | 116 self.difficulty = self.difficulty_max |
117 | 117 |
118 | 118 |
119 def change_music(self, track): | |
120 #TODO: don’t crash if the track has already be played. | |
121 bgm = self.bgms[track] | |
122 if bgm: | |
123 self.music.queue(bgm) | |
124 self.music.next() | |
125 | |
126 | |
127 def enable_spellcard_effect(self): | 119 def enable_spellcard_effect(self): |
128 self.spellcard_effect = Effect((-32., -16.), 0, | 120 self.spellcard_effect = Effect((-32., -16.), 0, |
129 self.spellcard_effect_anm_wrapper) #TODO: find why this offset is necessary. | 121 self.spellcard_effect_anm_wrapper) #TODO: find why this offset is necessary. |
130 self.spellcard_effect.sprite.allow_dest_offset = True #TODO: should be the role of anm’s 25th instruction. Investigate! | 122 self.spellcard_effect.sprite.allow_dest_offset = True #TODO: should be the role of anm’s 25th instruction. Investigate! |
131 | 123 |