在我的game_function中出现的错误,直接在check-events中加入按q退出选项就会出现这个报错,但是放在check-down中却提示这个错误game——function:importsysimportpygamefrombulletimportBulletdefcheck_keydown_events(event,ai_settings,screen,ship,bullets):ifevent.key==pygame.K_RIGHT:ship.moving_right=Trueelifevent.key==pygame.K_LEFT:ship.moving_left=Trueelifevent.key==pygame.K_SPACE:fire_bullet(ai_settings,screen,ship,bullets)elifevent.key==pygame.K_q:sys.exit()deffire_bullet(ai_settings,screen,ship,bullets):iflen(bullets)
添加回答
举报
0/150
提交
取消