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


Python Enemy.target方法代码示例

本文整理汇总了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
开发者ID:filareta,项目名称:battle_city_game,代码行数:19,代码来源:world.py

示例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
开发者ID:stormbreakerbg,项目名称:battle_city_game,代码行数:20,代码来源:world.py

示例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)
开发者ID:jacobRettig,项目名称:python-game-dev,代码行数:26,代码来源:usHistory.py


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