Object interaction with a background
We are going to want to make something separate happen when the balls touch the left boundary of the stage. This may mean a loss in points; however, for the time being we'll just make it end the game.
Getting ready
We'll first turn our attention to the stage. More specifically, we need to adjust our white background. Our goal is to find a way to differentiate the left boundary of the stage from the rest of the stage.
Get this started by going to the Backdrops tab of the stage script area. There we see our default white background. We'll also see the Paint Editor.
You will notice the rectangle tool on the side. Click on that and make a thin line moving from the top of the stage to the bottom on the left. Refer to the following screenshot for a guideline. Make sure you make the line thick enough so that it will be detected with the blocks we are about to add:
We're ready to go!
How to do it...
Return to the script area for either ball and perform the following...