collision detection and keyboard/mouse input topics covered in this collision detection don' modify list while iterating over it keyboard input in pygame mouse input in pygame collision detection is figuring when two things on the screen have touched (that iscollided witheach other for exampleif the player touches an enemy they may lose health or the program needs to know when the player touches coin so that they automatically pick it up collision detection can help determine if the game character is standing on solid ground or if there' nothing but empty air underneath them in our gamescollision detection will determine if two rectangles are overlapping each other or not our next example program will cover this basic technique later in this we'll look at how our pygame programs can accept input from the user through the keyboard and the mouse it' bit more complicated than calling the input(function like we did for our text programs but using the keyboard is much more interactive in gui programs and using the mouse isn' even possible in our text games these two concepts will make your games more excitingsource code of the collision detection program much of this code is similar to the animation programso the explanation of the moving and bouncing code is skipped (see the animation program in for that bouncer will bounce around the window list of rect objects will represent food squares on each iteration through the game loopthe program will read each rect object in the list and draw green square on the window every forty iterations through the game loop we will add new rect object to the list so that the screen constantly has new food squares in it post questions to