comparison pytouhou/game/item.pyx @ 473:1c891c71cf22

Cythonize pytouhou.game.text.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 16 Sep 2013 18:42:12 +0200
parents 8038f1957b71
children 6be9c99a3a24
comparison
equal deleted inserted replaced
472:8038f1957b71 473:1c891c71cf22
92 player_state.power += (1 if self._type == 0 else 8) 92 player_state.power += (1 if self._type == 0 else 8)
93 if player_state.power > 128: 93 if player_state.power > 128:
94 player_state.power = 128 94 player_state.power = 128
95 for level in (8, 16, 32, 48, 64, 96): 95 for level in (8, 16, 32, 48, 64, 96):
96 if old_power < level and player_state.power >= level: 96 if old_power < level and player_state.power >= level:
97 label = self._game.new_label((self.x, self.y), ':') # Actually a “PowerUp” character. 97 label = self._game.new_label((self.x, self.y), b':') # Actually a “PowerUp” character.
98 color = 'blue' 98 color = 'blue'
99 label.set_color(color) 99 label.set_color(color)
100 labeled = True 100 labeled = True
101 else: 101 else:
102 bonus = player_state.power_bonus + (1 if self._type == 0 else 8) 102 bonus = player_state.power_bonus + (1 if self._type == 0 else 8)