def fireShell(xy, tankx, tanky, turPos, gun_power):
fire = True
startingShell = list(xy) # from tuple to list conversion
# print ("FIRE!", xy)
while fire:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
# print startingShell[0], startingShell[1]
pygame.draw.circle(gameDisplay, red, (startingShell[0], startingShell[1]), 5)
startingShell[0] -= (12 - turPos)*2
# y = x**2
startingShell[1] += int((((startingShell[0] - xy[0])*0.015)**2) - (turPos + turPos/(12-turPos)))
if startingShell[1] > display_height:
fire = False
pygame.display.update()
clock.tick(60)
评论列表
文章目录