Example #1
0
 def draw(self, image = None):
   if self.state == 'ouch' and timer.blink(0.1):
     Sprite.draw(self, image, 0.5)
   else:
     Sprite.draw(self, image)
   if self.state == 'frozen' and not self.ice:
     self.ice = True
     self.draw(res.getTexture("iceblock"))
     self.ice = False
Example #2
0
  def draw(self, image = None, alpha = 1.0):
    if image:
      image.bind()
    else:
      self.img.bind()

    if self.state == "ouch" and timer.blink(0.1):
      glColor4f(1.0, 1.0, 1.0, alpha / 2)
    else:
      glColor4f(1.0, 1.0, 1.0, alpha)

    glPushMatrix()
    glTranslatef(self.x, self.y, 0)
    if self.vx < 0:
      glTranslatef(self.w, 0, 0)
      glScalef(-1, 1, 0)
    glScalef(self.w, self.h, 1)

    util.quad()
    
    glPopMatrix()