****** - Verified Buyer
4.5
I was searching for tutorials about how to deal with 2D collisions in game code. After some Internet research I was more puzzled than before. Despite there are plenty of tutorials and articles about collision detection online, I wasn't sure how they should go together. What's more, the majority of articles discussed just collisions of 3D objects. So I went on, searching for a book about 2D collision detection and found this one.Initially I was irritated about the short length of the book. But after reading the first few chapters, the concise writing style made it clear that it's long enough.The book starts with explaining the basics of 2D vector math like addition, scaling, dot product, projection, etc. The next chapter introduces different collision shapes like circles, rectangles, lines and so on. Then comes the chapter I was most interested in: how collisions between different shapes are determined. It covers every possible combination of shapes, even the somewhat senseless point-point collision.One thing I was missing were polygons. In 3D everything seems to be some kind of "3D polygon". Thus I've expected the same goes for 2D.The book goes on with describing collision detection of moving objects, how to make up sprites with multiple shapes and some optimization advice for programming in general.I found the code, set up in the book, was easy to integrate into my own game. There is a link in the appendix to download the full code.The algorithms presented are well explained and easy to grasp. Just the functions for oriented rectangles are a little complex. But I think that's due to their nature of arbitrary rotation.In a nutshell:"2D Game Collision Detection" is a must for everybody who wants to implement 2D collisions, especially if you have no clue how collision detection is done. The concepts are well explained by many code examples and illustrations. As said, it was way easier to start with this book than to work through all the articles (mainly on 3D) I've found online. This book simply sums it all up into one guide.