Time for action – renaming, duplicating, and modifying a level

The game file to import and load for this session is 5961_07_05.stencyl.

  1. In the Dashboard tab, click on Scenes, double-click on the Jungle scene, then click on the Properties button in the row of gray buttons at the upper-center of the screen.
  2. Change the name of the scene to Level1 (the word Level followed by the digit one, without any spaces).
  3. Click on OK to confirm the change, then close the tab for the jungle scene (now called Level1).
  4. In the Scenes panel, in the Dashboard tab, right-click on the jungle scene (now called Level1) and select Duplicate from the pop-up menu.
  5. In the main panel, double-click on the Copy of Level1 scene thumbnail to open the scene.
  6. Click on the Properties button at the top of the Scene Designer, and rename the scene to Level2 (the word Level followed by the digit two, without any spaces).
  7. Make the desired changes to the new scene; add tiles and move tiles as required. Reposition the fruit, remembering that additional fruit actors can be added from the palette.
  8. When the scene is ready do not test the game.
  9. If we save the game, then look at the Scenes panel in the Dashboard tab (don't close the Level2 tab), we should see the following configuration:
    Time for action – renaming, duplicating, and modifying a level
  10. Switch back to the Level2 tab, and click on the green Test Scene button found above the palette in the right-hand panel.

What just happened?

We've created a new jungle scene for our players to complete!

Firstly, we renamed our original jungle scene, so it is now called Level1. We then made a copy of Level1 using the Duplicate feature, and renamed the new scene to Level2. Thefinal step was to modify the newly created scene, Level2, so that it presents a new challenge for our players. For testing purposes, we have ensured that the second level is not too difficult to complete, and this will enable us to continue with the development of the game without becoming too distracted by the small details relating to the challenges in the new scene.

It's important to understand that when we duplicate a scene, an exact copy of the scene is made with not only its tiles and actors, but also with all its behaviors! This is why the Drop actors randomly and Score Management behaviors work exactly as expected in the newly duplicated Level2 scene.

When testing the new scene, we took advantage of the Test Scene button, which enables us to test the scene that is currently being designed in the Scene Editor. This is an incredibly useful button; without it, we would have to play the whole game, starting with Level1 and successfully complete it, before we could test Level2. Testing our game in this manner would be a very tedious and time-consuming process with only two levels; imagine if our game had 10 levels to test!

Progressing through the levels

If we tested the game from the start, we would find that upon completion of Level1, the player would still be presented with the temporary Level Completed scene. Clearly, the desired action upon completion of scene Level1 is to allow the player to progress to Level2!

The good news is that we've already put much of the framework in place for this task. Firstly, in Chapter 6, Managing information, we created a game attribute for storing the current level, and secondly, we have recently given our two jungle scenes sensible names so that our game will be able to display them in the correct order.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.212.196