I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
Rectangles and obstacles

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 –

 

Helpful links

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

Your email address will not be published. Required fields are marked *

Information