コード例 #1
0
ファイル: spider.py プロジェクト: whichwayisup2/whichwayisup2
  def __init__(self, screen, x = None, y = None, attached = RIGHT):
    DynamicObject.__init__(self, screen, x, y, 10, False, False)
    self.animations["default"] = Animation("spider", "standing")
    self.animations["walking"] = Animation("spider", "walking")
    self.image = self.animations[self.current_animation].update_and_get_image()
    self.rect = self.image.get_rect()
    self.itemclass = "spider"

    self.attached = attached
    self.move_target = STAY
    self.fire_delay = 0
コード例 #2
0
 def __init__(self, screen, x, y, dx, dy, damage = 5, set = "energy"):
   DynamicObject.__init__(self, screen, x, y, -1, False, False)
   self.animations["default"] = Animation(set, "flying")
   self.animations["dying"] = Animation(set, "dying")
   self.image = self.animations[self.current_animation].update_and_get_image()
   self.rect = self.image.get_rect()
   self.dx = dx
   self.dy = dy
   self.saveddx =  None
   self.damage = damage
   self.itemclass = "projectile"
   return
コード例 #3
0
ファイル: blob.py プロジェクト: whichwayisup2/whichwayisup2
 def __init__(self, screen, x, y, player):
   DynamicObject.__init__(self, screen, x, y, 10, True, True)
   self.animations["default"] = Animation("blob", "standing")
   self.animations["dying"] = Animation("blob", "dying")
   self.animations["jumping"] = Animation("blob", "jumping")
   self.animations["falling"] = Animation("blob", "falling")
   self.image = self.animations[self.current_animation].update_and_get_image()
   self.rect = self.image.get_rect()
   self.rect.centerx = int(self.x)
   self.rect.centery = int(self.y)
   self.jump_queue = False
   self.itemclass = "blob"
   self.player = player
   return
コード例 #4
0
ファイル: player.py プロジェクト: whichwayisup2/whichwayisup2
  def __init__(self, screen, character, x=None, y=None):
    DynamicObject.__init__(self, screen, x, y, PLAYER_LIFE, True, True)
    
    #Changing some of the values from DynamicObject, the animations should probably actually be parsed from a file:
    self.animations["default"] = Animation(character, "standing")
    self.animations["jumping"] = Animation(character, "standing")
    for anim in ('walking', 'arrow', 'dying', 'shouting', 'exit', 'gone'):
      self.animations[anim] = Animation(character, anim)
    
    self.image = self.animations[self.current_animation].update_and_get_image()
    self.rect = self.image.get_rect()
    self.itemclass = "player"

    #Variables specific to this class:
    self.inventory = []
    self.umbrella_on = False
コード例 #5
0
  def __init__(self, screen, x = None, y = None):
    DynamicObject.__init__(self, screen, x, y, PLAYER_LIFE, True, True)
    #Changing some of the values from DynamicObject, the animations should probably actually be parsed from a file:
    self.animations["default"] = Animation("guy", "standing")
    self.animations["walking"] = Animation("guy", "walking")
    self.animations["arrow"] = Animation("guy", "arrow")
    self.animations["dying"] = Animation("guy", "dying")
    self.animations["shouting"] = Animation("guy", "shouting")
    self.animations["jumping"] = Animation("guy", "standing")
    self.animations["exit"] = Animation("guy", "exit")
    self.animations["gone"] = Animation("guy", "gone")
    self.image = self.animations[self.current_animation].update_and_get_image()
    self.rect = self.image.get_rect()
    self.itemclass = "player"

    #Variables spesific to this class:
    self.inventory = []
    self.umbrella_on = False
    return