当前位置: 首页>>代码示例>>Python>>正文


Python Monster.__init__方法代码示例

本文整理汇总了Python中monster.Monster.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Monster.__init__方法的具体用法?Python Monster.__init__怎么用?Python Monster.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在monster.Monster的用法示例。


在下文中一共展示了Monster.__init__方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
	def __init__(self):

		Hero.__init__(self)
		Monster.__init__(self)


		self.where = "on shoulders"
开发者ID:PDXCodeGuildJan,项目名称:Shawn-s-Assignments-PDXCode-Guild-16,代码行数:9,代码来源:hero.py

示例2: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
	def __init__(self):
		Monster.__init__(self) # we don't use super here because weird things will happen and overlap with multiple
		#inheritance
		Hero.__init__(self) # instead of super, we must specificy each parent class from which MonsterHero
		#is inheriting

		self.second_weapon = None # staying consistent with weapon variable
开发者ID:PDXCodeGuildJan,项目名称:AlexisRepo,代码行数:9,代码来源:hero.py

示例3: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
	def __init__(self):
		# Takes this instance(self) of Monster and adds all init properties from Monster class
		Monster.__init__(self)
		# Takes this instance(self) of Monster and adds all init properties from Monster class
		Hero.__init__(self)
		#MonsterHero to have a second weapon
		self.second_weapon = "second weapon!"
开发者ID:PDXCodeGuildJan,项目名称:KatieCGBootcamp,代码行数:9,代码来源:hero.py

示例4: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
 def __init__(self, x, y, name, oid=None, ai=None, hp=None, max_hp=None,
              mp=None, max_mp=None, death=None, fov_radius=cfg.TORCH_RADIUS,
              inventory=None):
     if death is None:
         death = player_death
     Monster.__init__(self, x, y, name, oid=oid, ai=ai, hp=hp,
                      max_hp=max_hp, mp=mp, max_mp=max_mp, death=death,
                      fov_radius=fov_radius, inventory=inventory)
开发者ID:aruse,项目名称:Bludgeon,代码行数:10,代码来源:player.py

示例5: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
   def __init__(self):
      #super is a builtin python function that represents the parent class of
      #this object (parent class = Creature here). This makes a monster inside  
      #the parent class of creature, with all the properties of creature. 

      Monster.__init__(self)
      Hero.__init__(self)
      
      self.weapon2 = None
开发者ID:Pjmcnally,项目名称:teaching,代码行数:11,代码来源:monsterhero.py

示例6: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
    def __init__(self,x,y):
        Monster.__init__(self,x,y,0,BAT_RADIUS,BAT_MOVE_SPEED)

        self._color = BAT_COLOR
        self._hp    = BAT_HP
        self._timer = BAT_TIMER
        self._base_speed = self._speed
        self._boost = self._speed * BAT_BOOST_SPEED
        self._randangle = choice([1,-1])
开发者ID:tc30nguyen,项目名称:pyShotGame,代码行数:11,代码来源:bat.py

示例7: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
  def __init__(self, move_time, nodes):
    Monster.__init__(self, move_time, nodes)
    self.image_inside.fill((142, 163, 12))
    self.image.blit(self.image_inside, (1, 1))
    self.rect = Rect(self.pos, (40, 40))
    self.speed = 1
    self.diag_speed = 3
    self.value = 10
    self.health = 100
    self.armor = 500

    self.name = "Armored Monster"
    self.description = "An armored monster that takes progressively more damage as it is hit"
开发者ID:brandonsturgeon,项目名称:Tower_Defense,代码行数:15,代码来源:armor_monster.py

示例8: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
 def __init__(self, move_time, nodes):
     Monster.__init__(self, move_time, nodes)
     self.image = Surface((20, 20)).convert()
     self.image_inside = Surface((18, 18)).convert()
     self.image_inside.fill((255, 255, 0))
     self.image.blit(self.image_inside, (1, 1))
     self.rect = Rect(self.pos, (40, 40))
     self.speed = 4
     self.diag_speed = 3
     self.value = 0.5
     self.health = 50
     self.name = "Fast Monster"
     self.description = "A small monster with very quick movement speed, but low health."
开发者ID:brandonsturgeon,项目名称:Tower_Defense,代码行数:15,代码来源:fast_monster.py

示例9: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
	def __init__(self):
		Monster.__init__(self)
		Hero.__init__(self)

		self.second_weapon = self.weapon	
开发者ID:PDXCodeGuildJan,项目名称:kris_kuchinka_repo,代码行数:7,代码来源:hero.py

示例10: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
    def __init__(self,x,y):
        Monster.__init__(self,x,y,0,ZOMBIE_RADIUS,ZOMBIE_MOVE_SPEED)

        self._color = ZOMBIE_COLOR
        self._hp    = ZOMBIE_HP
开发者ID:tc30nguyen,项目名称:pyShotGame,代码行数:7,代码来源:zombie.py

示例11: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
	def __init__(self):
		Monster.__init__(self) 
		Hero.__init__(self)

		#self.weapon = Monster_hero.SECOND_WEAPON
开发者ID:PDXCodeGuildJan,项目名称:SarahPDXCode2016,代码行数:7,代码来源:hero.py

示例12: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
 def __init__(self,x,y):
     Monster.__init__(self,x,y,0,GHOUL_RADIUS,GHOUL_MOVE_SPEED)
     
     self._color = GHOUL_COLOR
     self._hp    = GHOUL_HP
开发者ID:tc30nguyen,项目名称:pyShotGame,代码行数:7,代码来源:ghoul.py

示例13: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
    def __init__(self,x,y):
        Monster.__init__(self,x,y,0,ABOM_RADIUS,ABOM_MOVE_SPEED)

        self._color = ABOM_COLOR
        self._hp = ABOM_HP
开发者ID:tc30nguyen,项目名称:pyShotGame,代码行数:7,代码来源:abomination.py

示例14: __init__

# 需要导入模块: from monster import Monster [as 别名]
# 或者: from monster.Monster import __init__ [as 别名]
 def __init__(self):
    #passing the memory reference of self and calling monster initiation
    Monster.__init__(self)
    #passing the memory ref of self and calling hero initiation 
    Hero.__init__(self)
开发者ID:PDXCodeGuildJan,项目名称:Shanna,代码行数:7,代码来源:monster_hero.py


注:本文中的monster.Monster.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。