Mercurial > touhou
comparison pytouhou/game/laser.py @ 384:690b5faaa0e6
Make rendering of multiple-sprites elements work like single-sprites.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Tue, 02 Oct 2012 13:27:05 +0200 |
parents | 14c9aca8e274 |
children | b11953cf1d3b |
comparison
equal
deleted
inserted
replaced
383:0537af9125a7 | 384:690b5faaa0e6 |
---|---|
26 self._laser = laser | 26 self._laser = laser |
27 self.sprite = Sprite() | 27 self.sprite = Sprite() |
28 self.sprite.anm, self.sprite.texcoords = anm_wrapper.get_sprite(index) | 28 self.sprite.anm, self.sprite.texcoords = anm_wrapper.get_sprite(index) |
29 self.sprite.blendfunc = 1 | 29 self.sprite.blendfunc = 1 |
30 self.removed = False | 30 self.removed = False |
31 self.objects = [self] | |
31 self.x, self.y = 0, 0 | 32 self.x, self.y = 0, 0 |
32 | 33 |
33 | 34 |
34 def update(self): | 35 def update(self): |
35 laser = self._laser | 36 laser = self._laser |
63 self._laser_type = laser_type | 64 self._laser_type = laser_type |
64 self.state = STARTING | 65 self.state = STARTING |
65 self.sprite = None | 66 self.sprite = None |
66 self.anmrunner = None | 67 self.anmrunner = None |
67 self.removed = False | 68 self.removed = False |
69 self.objects = [self] | |
68 | 70 |
69 #TODO: hitbox | 71 #TODO: hitbox |
70 | 72 |
71 self.frame = 0 | 73 self.frame = 0 |
72 self.start_duration = start_duration | 74 self.start_duration = start_duration |
199 self.sprite = None | 201 self.sprite = None |
200 self.anmrunner = None | 202 self.anmrunner = None |
201 self.removed = False | 203 self.removed = False |
202 self._laser_type = laser_type | 204 self._laser_type = laser_type |
203 self.origin = origin | 205 self.origin = origin |
206 self.objects = [self] | |
204 | 207 |
205 self.hitbox_half_size = hitbox[0] / 2., hitbox[1] / 2. | 208 self.hitbox_half_size = hitbox[0] / 2., hitbox[1] / 2. |
206 | 209 |
207 self.frame = 0 | 210 self.frame = 0 |
208 self.duration = duration | 211 self.duration = duration |