本文整理汇总了Python中enemy.Enemy.getEnemyList方法的典型用法代码示例。如果您正苦于以下问题:Python Enemy.getEnemyList方法的具体用法?Python Enemy.getEnemyList怎么用?Python Enemy.getEnemyList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enemy.Enemy
的用法示例。
在下文中一共展示了Enemy.getEnemyList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generateAllEnemies
# 需要导入模块: from enemy import Enemy [as 别名]
# 或者: from enemy.Enemy import getEnemyList [as 别名]
# generate new enemies
generateAllEnemies()
# generate new events
eventBlueCorner()
# draw enemies and projectiles
drawEnemies()
drawProjectiles()
# move enemies and projectiles
moveEnemies()
moveProjectiles()
# check for any collisions
if collisionDetection(DISPLAYSURF, BLACK, enemy.getEnemyList(), proj.projectile_list, my_character) == True:
# add player to the database
insertPlayerRecord(statistics.name, statistics.total_kills, statistics.total_deaths, statistics.blue_kills, statistics.green_kills, statistics.red_kills, statistics.purple_kills, statistics.shots_fired, statistics.shots_hit, statistics.accuracy)
# clear the display and show the play again menu
DISPLAYSURF.fill((0,0,0))
playAgainMenuOptions = [Option(DISPLAYSURF, BLUE, font, "YES", (config.display_x // 2 - 30, config.display_y // 2)),
Option(DISPLAYSURF, BLUE, font, "NO", (config.display_x // 2 - 20, config.display_y // 2 + 100)), Option(DISPLAYSURF, BLUE, font, "MAIN MENU", (config.display_x // 2 - len("MAIN MENU") * 10, config.display_y - 100))]
while(playAgainMenu):
playAgainMenu = drawPlayAgainMenu(DISPLAYSURF)
# update statistics
if statistics.shots_fired != 0:
statistics.accuracy = statistics.shots_hit / statistics.shots_fired
statistics.accuracy = round(statistics.accuracy, 2)