本文整理汇总了Python中Ship.repos方法的典型用法代码示例。如果您正苦于以下问题:Python Ship.repos方法的具体用法?Python Ship.repos怎么用?Python Ship.repos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ship
的用法示例。
在下文中一共展示了Ship.repos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import Ship [as 别名]
# 或者: from Ship import repos [as 别名]
#.........这里部分代码省略.........
while True and not done:
while not done and not menuscreen and not paused:# and not shopping:
for event in pygame.event.get():
#Input handling
if event.type == pygame.QUIT:
done = True
if event.type == pygame.KEYDOWN:
if event.key == K_RIGHT:
if my_ship.x < 1000-32:
my_ship.isright = True
my_ship.hb_follow()
if event.key == K_LEFT:
my_ship.isleft = True
my_ship.hb_follow()
if event.key == K_DOWN:
if my_ship.y < 564:
my_ship.isdown = True
my_ship.hb_follow()
if event.key == K_UP:
if my_ship.y >= 4:
my_ship.isup = True
my_ship.hb_follow()
if event.key == K_x:
my_ship.firing = True
if event.key == K_p:
paused = togglepause(paused)
if event.type == pygame.KEYUP:
if event.key == K_RIGHT:
my_ship.repos()
my_ship.isright = False
if event.key == K_LEFT:
my_ship.repos()
my_ship.isleft = False
if event.key == K_UP:
my_ship.isup = False
if event.key == K_DOWN:
my_ship.isdown = False
if event.key == K_x:
my_ship.firing = False
if my_ship.overheat < 44:
pass#my_ship.can_shoot = True
#Game Logic Below. Lots of game logic is stored in the classes as well.
for i in range(len(weapons)):
try:
allsprites.append(weapons[i])
weapons.remove(weapons[i])
except:
pass
else:
pass
'''Start of code that spawns in enemies'''
if score in range(LEVEL8,LEVEL9):
level = 8
if level8shopping == False:
level8shopping = True
shopping = True