15. Collision Detection
This chapter reviews how collision detection has been implemented within Sir Lamorak’s Quest, as well as the common problems that need to be solved. Without collision detection, the player and game characters would be able to wander through walls, and we’d have no way of knowing when the player or entities hit each other.
Although this chapter is titled “Collision Detection,” it is important to remember that collision response should also be included. Detecting a collision and then responding are two different stages that need to be managed separately. This doesn’t mean that they cannot physically be managed together in code, but that they should be considered separately when designing and implementing collision detection ...
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.
Read now
Unlock full access