Time for action — load custom levels
We are now going to modify our game to load levels from the INI file. This will allow us to add and remove levels at will, as well as share them with friends.
1. Open the
BounceBall
project again andclone
the last level layout using the technique we learned in Chapter 5, Practical Physics.2. Name this layout
LevelINI
and its event sheet toLevelINI Events
.3. Delete the background image object and create a new one. This time, name it
BackgroundINI
and use a default image for it (to show the correct image has not loaded, or no image exists). A No Image example is shown in the following screenshot, namedBackNA.png:
4. Now, also create the background image that we will use for our first custom level and name it
Back3.png
(as we entered in the INI file). Save this to theBounceBall
project folder and return to Construct Classic:5. Next, delete all but one of the
Peg
objects on the new layout, and move this last peg outside of the layout.6. Then move both...