Source

pymissile / actor.py

class Actor(object):
  
  def __init__(self, die_callback=None, **kwargs):
    self.scene = kwargs['scene']
    self._die_callback = die_callback
    self.z = 0
    self.scene.create(self)
    self._alpha = 255
    
  def die(self):
    self.scene.destroy(self)
    if self._die_callback: self._die_callback()

  def update(self):
    pass
    
  def draw(self, screen):
    pass
  
  def _decrease_alpha(self, amount=1):
    if self._alpha > 0: 
      self._alpha -= amount
      self._alpha = max(self._alpha, 0)