我想在pygame中制作一个射手。我可以让玩家四处移动,当按下空间时,子弹就会移动到其位置。我想知道如何让它离开玩家,直到它碰到屏幕边缘。这是我到目前为止:在Pygame中拍摄
if AMMO > 0:
if event.type == pygame.KEYDOWN and Gun.image == NOGUN:
if event.key == pygame.K_SPACE and Gun.image == NOGUN:
Bullet.rect.center = Player.rect.center
if Player.direction == 0:
Bullet.direction = 0 #WHERE THE BULLET WILL MOVE
shot.play()
print "BANG"
AMMO = AMMO - 1
time.sleep(0.09)