diff pytouhou/game/player.pyx @ 527:db28538cd399

Use Sprite C arrays instead of their tuple representation where it makes sense.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 18 Dec 2013 18:19:08 +0100
parents 292fea5c584e
children e35bef07290d
line wrap: on
line diff
--- a/pytouhou/game/player.pyx
+++ b/pytouhou/game/player.pyx
@@ -208,10 +208,12 @@ cdef class Player(Element):
 
                 m = self.invulnerable_time % 8
                 if m == 7 or self.invulnerable_time == 0:
-                    self.sprite.color = (255, 255, 255)
+                    for i in xrange(3):
+                        self.sprite._color[i] = 255
                     self.sprite.changed = True
                 elif m == 1:
-                    self.sprite.color = (64, 64, 64)
+                    for i in xrange(3):
+                        self.sprite._color[i] = 64
                     self.sprite.changed = True
 
             if keystate & 1 and self.fire_time == 0:
@@ -280,7 +282,7 @@ cdef class Player(Element):
             elif time == 7:
                 self.sprite.mirrored = False
                 self.sprite.blendfunc = 0
-                self.sprite.rescale = 0.75, 1.5
+                self.sprite._rescale[:] = [0.75, 1.5]
                 self.sprite.fade(26, 96)
                 self.sprite.scale_in(26, 0., 2.5)
 
@@ -295,8 +297,8 @@ cdef class Player(Element):
 
                 self.sprite = Sprite()
                 self.anmrunner = ANMRunner(self.anm, 0, self.sprite)
-                self.sprite.alpha = 128
-                self.sprite.rescale = 0., 2.5
+                self.sprite._color[3] = 128
+                self.sprite._rescale[:] = [0., 2.5]
                 self.sprite.fade(30, 255)
                 self.sprite.blendfunc = 1
                 self.sprite.scale_in(30, 1., 1.)