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


Python Console.move方法代码示例

本文整理汇总了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)
开发者ID:freddyhard,项目名称:chasing_game,代码行数:33,代码来源:main.py

示例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]

开发者ID:Elder-of-Ozone,项目名称:ToTheMoon,代码行数:31,代码来源:consoleTest.py


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