Mercurial > touhou
comparison pytouhou/game/item.py @ 439:723a3e67a223
Make pytouhou.game.sprite an extension type.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 10 Aug 2013 20:48:17 +0200 |
parents | 690b5faaa0e6 |
children | b9d2db93972f |
comparison
equal
deleted
inserted
replaced
438:43a8fed9a8d8 | 439:723a3e67a223 |
---|---|
12 ## GNU General Public License for more details. | 12 ## GNU General Public License for more details. |
13 ## | 13 ## |
14 | 14 |
15 | 15 |
16 from math import cos, sin, atan2, pi | 16 from math import cos, sin, atan2, pi |
17 from copy import copy | |
18 | 17 |
19 from pytouhou.utils.interpolator import Interpolator | 18 from pytouhou.utils.interpolator import Interpolator |
20 | 19 |
21 | 20 |
22 class Indicator(object): | 21 class Indicator(object): |
23 def __init__(self, item): | 22 def __init__(self, item): |
24 self._item = item | 23 self._item = item |
25 | 24 |
26 self.sprite = copy(item._item_type.indicator_sprite) | 25 self.sprite = item._item_type.indicator_sprite.copy() |
27 self.removed = False | 26 self.removed = False |
28 | 27 |
29 self.frame = 0 | 28 self.frame = 0 |
30 self.x = self._item.x | 29 self.x = self._item.x |
31 self.y = self.sprite.texcoords[2] / 2. | 30 self.y = self.sprite.texcoords[2] / 2. |