Skip to Main Content
Advanced Game Design with HTML5 and JavaScript
book

Advanced Game Design with HTML5 and JavaScript

by Rex van der Spuy
May 2015
Intermediate to advanced content levelIntermediate to advanced
552 pages
14h 38m
English
Apress
Content preview from Advanced Game Design with HTML5 and JavaScript
© Rex van der Spuy 2015
Rex van der SpuyAdvanced Game Design with HTML5 and JavaScript10.1007/978-1-4302-5801-8_7

7. Collision Detection

Rex van der Spuy
(1)
Ontario, Canada
 
What happens when two sprites collide? That’s what this chapter is all about: collision detection. You’re going to learn how to determine if two sprites are touching, and make them react in interesting ways when they do. For 2D games, there are four essential collision detection techniques you need to know, and we’re going to cover all of them in this chapter:
  • Point vs. Shape: When a point intersects a shape
  • Circle vs. Circle: When two circles intersect
  • Rectangle vs. Rectangle: When two rectangles intersect
  • Circle vs. Rectangle: When a rectangle and a circle intersect
With ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Responsive Web Design with HTML5 and CSS - Fourth Edition

Responsive Web Design with HTML5 and CSS - Fourth Edition

Ben Frain

Publisher Resources

ISBN: 9781430258018Supplemental Content