Abstract
There are two main ways that you can check for collisions in games. The first is to compare the x and y pixel positions of sprites on the screen. If their shapes are overlapping, you have a collision. This is a collision detection strategy called narrow-phase collision. If you’ve used a game engine with collision functions that might have names like hitTestRectangle or hitTestCircle to check whether shapes are overlapping, it’s likely that these are narrow-phase collision functions. They use vector math (linear algebra) to figure out if the shapes of the sprites are overlapping. Because of that you can achieve very precise pixel-level collision accuracy, which is very important for physics-based action games.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Rex van der Spuy
About this chapter
Cite this chapter
van der Spuy, R. (2017). Tile-Based Collision. In: The Advanced Game Developer's Toolkit. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1097-0_3
Download citation
DOI: https://doi.org/10.1007/978-1-4842-1097-0_3
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-1098-7
Online ISBN: 978-1-4842-1097-0
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books