Before going further, you need to add the code that detect collisions between the rabbit and the puppet. When this happens, the blinking action should be run as well as the sound that is played when the rabbit collides with the wrong door. Also, you should take into account that colliding with the enemies will not affect the score.
I've decided to use a different flag to detect whether a collision with an enemy happened, as we will need it later in this chapter. So, let's add a new variable declaration at the top of
private var isEnemyCollisionDetected: Bool = false
Then, we need to write the code that detects these collisions. So, add the following block of code at the end of