Permalink
Browse files

fixed coin color

  • Loading branch information...
1 parent 890b505 commit bd044d2893828db10067a011fc9cd44008edea6f Alec Goebel committed Apr 26, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 samplecode/networking_example/coinget/client/sprites/coin.py
@@ -15,16 +15,19 @@ def __init__(self, coin):
self.rect = self.image.get_rect()
self.rect.center = coin.rect.center
-
self.coin = coin
dispatcher.connect(self.kill, signal=signals.DEL_OBJECT, sender=coin)
+ self.redraw()
+
def redraw(self):
rect = self.image.get_rect()
ratio = 1.0 * self.coin.life / settings.COIN_LIFE
self.image.fill((0,0,0))
self.image.fill((255,255 * ratio,0), rect.inflate(-4,-4))
+ def update(self):
+ self.redraw()
class CoinGroup(Group):
def __init__(self):

0 comments on commit bd044d2

Please sign in to comment.