本文整理汇总了Python中Ship.firing方法的典型用法代码示例。如果您正苦于以下问题:Python Ship.firing方法的具体用法?Python Ship.firing怎么用?Python Ship.firing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ship
的用法示例。
在下文中一共展示了Ship.firing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import Ship [as 别名]
# 或者: from Ship import firing [as 别名]
#.........这里部分代码省略.........
screen.blit(logo_image,(screen_size[0]/2-374/2,10))
pygame.display.flip()
clock.tick(40)
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