Mercurial > touhou
comparison pytouhou/game/game.pyx @ 457:4ccc47828002
Display the name of a spellcard and the face of its invoker.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 10 Aug 2013 13:36:42 +0200 |
parents | cae1ae9de430 |
children | 5f5955635d2c |
comparison
equal
deleted
inserted
replaced
456:cae1ae9de430 | 457:4ccc47828002 |
---|---|
44 self.players_bullets = [] | 44 self.players_bullets = [] |
45 self.players_lasers = [None, None] | 45 self.players_lasers = [None, None] |
46 self.items = [] | 46 self.items = [] |
47 self.labels = [] | 47 self.labels = [] |
48 self.faces = [None, None] | 48 self.faces = [None, None] |
49 self.texts = [None, None, None, None] | 49 self.texts = [None, None, None, None, None, None] |
50 self.interface = interface | 50 self.interface = interface |
51 self.hints = hints | 51 self.hints = hints |
52 | 52 |
53 self.continues = continues | 53 self.continues = continues |
54 self.stage = stage | 54 self.stage = stage |
98 elif self.difficulty > self.difficulty_max: | 98 elif self.difficulty > self.difficulty_max: |
99 self.difficulty = self.difficulty_max | 99 self.difficulty = self.difficulty_max |
100 | 100 |
101 | 101 |
102 def enable_spellcard_effect(self): | 102 def enable_spellcard_effect(self): |
103 self.spellcard_effect = Effect((-32., -16.), 0, | 103 pos = (-32, -16) |
104 self.spellcard_effect_anm) #TODO: find why this offset is necessary. | 104 self.spellcard_effect = Effect(pos, 0, |
105 self.spellcard_effect.sprite.allow_dest_offset = True #TODO: should be the role of anm’s 25th instruction. Investigate! | 105 self.spellcard_effect_anm) |
106 self.spellcard_effect.sprite.allow_dest_offset = True | |
107 | |
108 face = Effect(pos, 3, self.msg_anm[0][0][0]) | |
109 face.sprite.allow_dest_offset = True | |
110 face.sprite.anm, face.sprite.texcoords = self.msg_anm[1][self.spellcard[2]] | |
111 self.effects.append(face) | |
112 | |
113 self.texts[5] = self.new_native_text((384-24, 24), self.spellcard[1], align='right') | |
106 | 114 |
107 | 115 |
108 def disable_spellcard_effect(self): | 116 def disable_spellcard_effect(self): |
109 self.spellcard_effect = None | 117 self.spellcard_effect = None |
118 self.texts[5] = None | |
119 | |
120 | |
121 def set_player_bomb(self): | |
122 face = Effect((-32, -16), 1, self.msg_anm[0][0][0]) | |
123 face.sprite.allow_dest_offset = True | |
124 self.effects.append(face) | |
125 self.texts[4] = self.new_native_text((24, 24), u'Player Spellcard') | |
126 | |
127 | |
128 def unset_player_bomb(self): | |
129 self.texts[4] = None | |
110 | 130 |
111 | 131 |
112 cpdef drop_bonus(self, double x, double y, long _type, end_pos=None): | 132 cpdef drop_bonus(self, double x, double y, long _type, end_pos=None): |
113 if _type > 6: | 133 if _type > 6: |
114 return | 134 return |