本文整理汇总了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"
示例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
示例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!"
示例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)
示例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
示例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])
示例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"
示例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."
示例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
示例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
示例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
示例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
示例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
示例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)