本文整理汇总了Python中enemy.Enemy.target方法的典型用法代码示例。如果您正苦于以下问题:Python Enemy.target方法的具体用法?Python Enemy.target怎么用?Python Enemy.target使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enemy.Enemy
的用法示例。
在下文中一共展示了Enemy.target方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_object
# 需要导入模块: from enemy import Enemy [as 别名]
# 或者: from enemy.Enemy import target [as 别名]
def _create_object(self, item, coords):
if item == 'Y':
self.players['1'] = Player(coords, 1)
elif item == 'G' and self.multiplayer:
self.players['2'] = Player(coords, 2)
elif item == 'F':
self.phoenix.append(coords)
elif item == 'E':
new_enemy = Enemy(coords)
self.enemies.append(Enemy(coords))
if (len(self.enemies) + 1) % 3 == 0:
new_enemy.target = "phoenix"
elif item == 'B' or item == 'W':
for position in coords:
self.walls.append(Wall(coords))
elif item == '#':
self.bounds = coords
示例2: _create_object
# 需要导入模块: from enemy import Enemy [as 别名]
# 或者: from enemy.Enemy import target [as 别名]
def _create_object(self, item, position):
if item == 'Y':
self.players['1'] = Player(position, 1)
elif item == 'G' and self.multiplayer:
self.players['2'] = Player(position, 2)
elif item == 'F':
self.phoenix.append(position)
elif item == 'E':
new_enemy = Enemy(position)
self.enemies.append(Enemy(position))
if (len(self.enemies) + 1) % 3 == 0:
new_enemy.target = "phoenix"
elif item == 'B':
self.walls.append(Wall(position, breakable=True))
elif item == 'W':
self.walls.append(Wall(position, breakable=False))
elif item == '#':
self.bounds = position
示例3: addEnemy
# 需要导入模块: from enemy import Enemy [as 别名]
# 或者: from enemy.Enemy import target [as 别名]
def addEnemy():
from enemy import Enemy
E = Enemy(world, (0, 0, World.SIZE/2))
E.speed = .05
E['eyes'] = 'none'
E['ears'] = 'none'
E['nose'] = 'none'
E['beard'] = 'none'
E['hair'] = 'none'
E['body'] = 'skeleton'
E['shirt'] = 'none'
E['shoes'] = 'none'
E['pants'] = 'skirt'
E['right hand'] = 'dagger'
E.acts = [attackEnemy, death]
E.speed = 1.5
import random
E.cen = world.map.openTiles[random.randint(0, len(world.map.openTiles) - 1)].cen()
E.target = E.cen()
world.entityList.add(E)