Mercurial > touhou
comparison pytouhou/game/game.py @ 321:61adb5453e46
Implement music playback.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 13 Jun 2012 15:29:43 +0200 |
parents | 1a4ffdda8735 |
children | 13201d90bb22 |
comparison
equal
deleted
inserted
replaced
320:1a4ffdda8735 | 321:61adb5453e46 |
---|---|
100 self.difficulty = self.difficulty_min | 100 self.difficulty = self.difficulty_min |
101 elif self.difficulty > self.difficulty_max: | 101 elif self.difficulty > self.difficulty_max: |
102 self.difficulty = self.difficulty_max | 102 self.difficulty = self.difficulty_max |
103 | 103 |
104 | 104 |
105 def change_music(self, track): | |
106 #TODO: don’t crash if the track has already be played. | |
107 bgm = self.bgms[track] | |
108 if bgm: | |
109 self.music.queue(bgm) | |
110 self.music.next() | |
111 | |
112 | |
105 def enable_spellcard_effect(self): | 113 def enable_spellcard_effect(self): |
106 self.spellcard_effect = Effect((-32., -16.), 0, | 114 self.spellcard_effect = Effect((-32., -16.), 0, |
107 self.spellcard_effect_anm_wrapper) #TODO: find why this offset is necessary. | 115 self.spellcard_effect_anm_wrapper) #TODO: find why this offset is necessary. |
108 self.spellcard_effect.sprite.allow_dest_offset = True #TODO: should be the role of anm’s 25th instruction. Investigate! | 116 self.spellcard_effect.sprite.allow_dest_offset = True #TODO: should be the role of anm’s 25th instruction. Investigate! |
109 | 117 |