Chapter     8

The Game, Part 4: Collision Events

In most action-oriented games, the notion of collision detection plays a primary role. Whether it’s detecting when Mario lands on a Koopa Troopa, or when Pac-Man gobbles a power pellet, or when Master Chief mêlées with a Covenant grunt, being able to detect when two objects come into contact is part and parcel of many types of games.

Astro Rescue is no exception. The gameCoreCollisionEvents.lua source file contains the event handler function (along with some related “stuff”) that is responsible for handling such events. In a very real sense, this code, although rather small in volume, is responsible for making the game work. I know, you could say that about the main game loop (and I think I may ...

Get Learn Corona SDK Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.