我在试着在pygame中做一个射手。我可以让玩家四处移动,当按下空格键时,子弹就会回到它的位置。我想知道怎样才能让它远离播放器,直到它到达屏幕的边缘。这是我到目前为止所知道的: if event.type == pygame.KEYDOWN and Gun.image == NOGUN: Bullet.
joystick = pygame.joystick.Joystick(0)
# Get the latest events from the system events = pygame.event.get()# Handle each event individually if event.type ==