Time for action – enabling the Debug Drawing feature
The game file to import and load for this session is 5961_03_01.stencyl
.
Stencyl makes it incredibly easy to see how collision detection is configured within our game; all we have to do is use the Enable Debug Drawing
feature.
On the main menu in Stencyl, select Run | Enable Debug Drawing.
Test the game.
Navigate the monkey around the scene and take note of where the colored lines appear around the monkey and the tiles.
Close the Adobe Flash Player window.
What just happened?
We've enabled the option that displays the debug drawing feature in Stencyl. When we tested the game with debug drawing enabled, we could see that colored lines are drawn around the monkey actor and the tiles.
These lines, which are normally invisible to players of our game, are used by Stencyl to determine when collisions have occurred, that is, when the lines of any two objects intersect (or touch) each other. If we examine some of the colored lines more closely, we can...