I Haz Codes
In this tutorial you will see how to do collision detection using rectangles. When testing if two things have collided you need to consider how accurate you want to be. In this set of examples we are doing collision detection with rectangles which means, as we have a ball, it may not always look smooth.
https://www.youtube.com/watch?v=9S_3eLioqjk
Some sample code to try –
http://tech.pro/tutorial/1007/collision-detection-with-pygame
http://thepythongamebook.com/en:pygame:step018 – Using masks to perform collision detection (advanced)
Leave a Reply