comparison pytouhou/game/effect.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 bdcf2077e368
children ac2891afb0bb
comparison
equal deleted inserted replaced
383:0537af9125a7 384:690b5faaa0e6
24 def __init__(self, pos, index, anm_wrapper): 24 def __init__(self, pos, index, anm_wrapper):
25 self.sprite = Sprite() 25 self.sprite = Sprite()
26 self.anmrunner = ANMRunner(anm_wrapper, index, self.sprite) 26 self.anmrunner = ANMRunner(anm_wrapper, index, self.sprite)
27 self.anmrunner.run_frame() 27 self.anmrunner.run_frame()
28 self.removed = False 28 self.removed = False
29 self.objects = [self]
29 30
30 self.x, self.y = pos 31 self.x, self.y = pos
31 32
32 33
33 def update(self): 34 def update(self):
46 self._game = game 47 self._game = game
47 48
48 self.sprite = Sprite() 49 self.sprite = Sprite()
49 self.sprite.anm, self.sprite.texcoords = anm_wrapper.get_sprite(index) 50 self.sprite.anm, self.sprite.texcoords = anm_wrapper.get_sprite(index)
50 self.removed = False 51 self.removed = False
52 self.objects = [self]
51 53
52 self.x, self.y = start_pos 54 self.x, self.y = start_pos
53 self.frame = 0 55 self.frame = 0
54 self.sprite.alpha = 128 56 self.sprite.alpha = 128
55 self.sprite.blendfunc = 1 57 self.sprite.blendfunc = 1