"""respond to keypresses and mouse events ""for event in pygame event get()if event type =pygame quitsys exit(elif event type =pygame keydowncheck_keydown_events(eventshipelif event type =pygame keyupcheck_keyup_events(eventshipwe make two new functionscheck_keydown_events(and check_keyup_ events(each needs an event parameter and ship parameter the bodies of these two functions are copied from check_events()and we've replaced the old code with calls to the new functions the check_events(function is simpler now with this cleaner code structurewhich will make it easier to develop further responses to player input quick recap in the next sectionwe'll add the ability to shoot bulletswhich involves new file called bullet py and some modifications to some of the files we already have right nowwe have four files containing number of classesfunctionsand methods to be clear about how the project is organizedlet' review each of these files before adding more functionality alien_invasion py the main filealien_invasion pycreates number of important objects used throughout the gamethe settings are stored in ai_settingsthe main display surface is stored in screenand ship instance is created in this file as well also stored in alien_invasion py is the main loop of the gamewhich is while loop that calls check_events()ship update()and update_screen(alien_invasion py is the only file you need to run when you want to play alien invasion the other files--settings pygame_functions pyship py-contain code that is importeddirectly or indirectlyinto this file settings py the settings py file contains the settings class this class only has an __init__(methodwhich initializes attributes controlling the game' appearance and the ship' speed game_functions py the game_functions py file contains number of functions that carry out the bulk of the work in the game the check_events(function detects relevant eventssuch as keypresses and releasesand processes each of these types of events through the helper functions check_keydown_events(and