Collision Detection

SECTION 4

CHALLENGES

Try these challenge prompts to modify the code we've written:

  1. Can you add to the code so the polygon edge that is hit gets highlighted?
  2. Can you make polygons whose vertices change position over time and watch them collide? Hint: you can use random(), but for more natural motion, look at the Perlin noise example in Basics > Math > Noise2D in the Processing IDE.
  3. Randomized polygons make great abstract monsters! Can you build a simple game with polygonal monsters chasing each other?

NEXT: Triangle/Point