本文整理汇总了Python中GameLogic.createGame方法的典型用法代码示例。如果您正苦于以下问题:Python GameLogic.createGame方法的具体用法?Python GameLogic.createGame怎么用?Python GameLogic.createGame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameLogic
的用法示例。
在下文中一共展示了GameLogic.createGame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exit
# 需要导入模块: import GameLogic [as 别名]
# 或者: from GameLogic import createGame [as 别名]
if GameLogic.hero.x > 1130 and GameLogic.hero.y != 0:
GameLogic.pressRight = False
if event.type == pygame.KEYUP:
if event.key == pygame.K_UP:
GameLogic.pressUp = False
elif event.key == pygame.K_LEFT:
GameLogic.pressLeft = False
elif event.key == pygame.K_RIGHT:
GameLogic.pressRight = False
elif event.key == pygame.K_SPACE:
GameLogic.pressSpace = False
if event.type == pygame.MOUSEBUTTONDOWN:
if GameLogic.state == 'Main Menu':
if event.pos[0] >= GameLogic.btnX and event.pos[0] <= GameLogic.btnX + GameLogic.btnWidth and event.pos[1] >= GameLogic.btnY and event.pos[1] <= GameLogic.btnY + GameLogic.btnHeight:
GameLogic.state = 'Start'
GameLogic.createGame(GameLogic.levelList.level1)
if event.pos[0] >= GameLogic.btnX1 and event.pos[0] <= GameLogic.btnX1 + GameLogic.btnWidth1 and event.pos[1] >= GameLogic.btnY1 and event.pos[1] <= GameLogic.btnY1 + GameLogic.btnHeight1:
exit()
if event.pos[0]>=GameLogic.btnX2 and event.pos[0]<=GameLogic.btnX2 + GameLogic.btnWidth1 and event.pos[1] >=GameLogic.btnY2 and event.pos[1]<=GameLogic.btnY2+ GameLogic.btnHeight1:
GameLogic.state = 'Easy'
GameLogic.createGame(GameLogic.levelList.easylevel)
if GameLogic.pressUp == True and GameLogic.pressRight == True:
# if GameLogic.hero.y >= 360:
# GameLogic.hero.y -= 50
if GameLogic.hero.x >= 0:
GameLogic.hero.x += 0
GameLogic.pressUp = True
GameLogic.pressRight = True
if GameLogic.pressUp == True and GameLogic.pressLeft == True:
# if GameLogic.hero.y>=360: