Chapter 5: Collisions, Sensors & Contact Events

Professor Parse

In this chapter, you'll steer two robots through a puzzle, and you'll learn that "two things touched" is only the start of a collision. The big idea is that you decide what touches what: with pass-through IDs, one-sided walls, sensors that don't push back, and code that runs when contact begins or ends.

I'm still writing this chapter, step by step. In the meantime, you can play the finished game, and read the code and the assets that make it, so that you can run it and change it yourself.

Play the Game

The code that makes it:

The assets, which go in an assets folder next to the game: