本文整理汇总了Python中console.Console.move方法的典型用法代码示例。如果您正苦于以下问题:Python Console.move方法的具体用法?Python Console.move怎么用?Python Console.move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类console.Console
的用法示例。
在下文中一共展示了Console.move方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: keyCheck
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import move [as 别名]
# check the keyboard
keyCheck()
if not gamePaused:
# move player
player.move(player_ViewPort, lasers)
# update the viewport
player_ViewPort.move(player, MAP_WIDTH, MAP_HEIGHT)
# create a new group when civilians = 0
if len(people) == 0:
createGroup()
# update the display area
console.move(people, terminators, player)
# cycle through the move() for the arrays lasers, people and terminators
for f in range(len(lasers)):
lasers[f].move(player, people, terminators)
for f in range(len(people)):
people[f].move(player)
for f in range(len(terminators)):
terminators[f].move(player, lasers)
# remove any objects that have their attribute destroyed = true
lasers = removeDestroyed(lasers)
people = removeDestroyed(people)
terminators = removeDestroyed(terminators)
示例2: Console
# 需要导入模块: from console import Console [as 别名]
# 或者: from console.Console import move [as 别名]
planets = Test_DATA.planets
fleets = Test_DATA.fleets
user["planets"] = [copy.deepcopy(planets["p1"]), copy.deepcopy(planets["p2"])]
easy["planets"] = [copy.deepcopy(planets["p2"])]
user["fleets"] =[copy.deepcopy(fleets["fleet2"]), copy.deepcopy(fleets["fleet1"])]
print "before"
print user["fleets"][0]
#print user["fleets"][1]
console = Console(user, planets, fleets)
# Moving fleet1 @ p1 to p2
message = "MOVE"
console.move(user["fleets"][0], user["planets"][1], user["planets"][0])
for i in range(1,6):
print "\nAfter"
console.updateQueue()
print user["fleets"][0]
#print user["fleets"][1]