tank-game.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:pygame-robotics 作者: ioarun 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号