Time for action – displaying the introduction scene

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

When the game first loads up and appears onscreen, it starts immediately without giving the player any warning! We have already created a temporary Main Menu scene, which is displayed when the player clicks on the menu option button on either the success or the game over screen, but we should really spruce up the Main Menu scene and display it as an introduction to the game when it is first loaded:

  1. Download the following actors from StencylForge:
    • Stencyl Book Title Banner
    • Stencyl Book Title Credits
    • Stencyl Book Start Button
  2. Click on the Scenes option in the Dashboard tab.
  3. Click on the thumbnail for the Main Menu scene once, then click on the blue Mark as Starting Scene button at the lower-right corner of the screen; a gold star should appear on the upper-left corner of the Main Menu scene's thumbnail.
  4. Open the Main Menu scene and click on the gray Background button at the upper-center of the screen.
  5. Click on the + (plus) button found at the bottom of the Backgrounds panel and double-click on the Jungle Background thumbnail in the Choose a Background dialog box.
  6. Press Ctrl + R (Command + R on Mac OS X) and the screen will refresh.
  7. Click on the Scene button at the upper-center of the screen.
  8. Click on the Show Background button at the upper-right of the Scene Editor's horizontal toolbar, as highlighted in the following screenshot:
    Time for action – displaying the introduction scene
  9. Add the Stencyl Book Title Banner, Stencyl Book Title Credits, and Stencyl Book Start Button actors to the Main Menu scene as shown in the following screenshot:
    Time for action – displaying the introduction scene
  10. Add an On Actor input event to the Stencyl Book Start Button actors and add the instruction blocks as shown in the following screenshot:
    Time for action – displaying the introduction scene
  11. Test the game; make sure the Start button works!

What just happened?

We have customized the Main Menu scene so that it presents the name of the game to the user, along with the game credits and a functioning Start button, on an appropriate background.

Firstly, we added three new assets to the game: Stencyl Book Title Banner, Stencyl Book Title Credits, and Stencyl Book Start Button. Note that we didn't need to specify the physics properties for these actors because the scene has no gravity settings, and there is no movement occurring in the scene—the actors will happily stay exactly where we placed them without further configuration!

Up until this point in development, the Level1 scene had been the starting scene for the game, but now that we have a functioning Main Menu, we have set it to be the starting scene, so that it is displayed when the game loads.

A plain background for our introductory scene doesn't provide a very good first impression for our game, so our next task was to add the Jungle Background to the scene. By default, backgrounds are not displayed in the scene editor, so we needed to click on the Show Background button to show the image, but before showing the background in the scene view, we refreshed the scene using the keyboard shortcut Ctrl + R (Command + R on Mac OS X). Refreshing the screen forces the changes to the background to be saved, so that it will be visible in the scene editor.

We could have designed and imported a different image for the Main Menu background, but for our purposes, the existing background looks the part. Another advantage of reusing existing assets, such as backgrounds, is that the file-size of the game will be smaller than if we added additional assets.

With the background visible, we were then able to position the required actors onscreen. In the screenshot of the example Main Menu scene shown in the previous step 9, it can be seen that the title actor showing the Monkey Run image has been positioned at an angle. This was achieved by placing the actor into the scene, then moving the cursor slightly outside any corner of the selection area for the actor, at which point the rotation cursor is displayed. Clicking-and-dragging the mouse when the rotation cursor is displayed will rotate the actor around its rotation point; usually the center of the actor. The following screenshot shows the rotation cursor (highlighted by a circle) positioned just outside the corner of the selection box for the Stencyl Book Title Banner actor.

What just happened?

The actor has also been stretched to make it larger, and this can be accomplished simply by clicking-and-dragging one of the corner handles for the actor—the handles are the miniature boxes displayed at the corners and sides of a selection box, also visible in the previous screenshot.

Tip

Holding the Shift key on the keyboard while stretching an actor ensures that the width and height remain proportional to each other, rather than being distorted.

With the design of the Main Menu scene completed, the final step was to add a custom event to the Stencyl Book Start Button actor to make it do its job of starting the game. The event resets the Lives game attribute to 3 and switches to the Level1 scene, using the specified transition effect of Slide Right, when the actor is clicked.

Have a go hero

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

Our Main Menu scene is perfectly adequate for a sample game, but it would benefit from a little more attention to the design and theme of the game!

Consider implementing the following:

  • Introduce the monkey character to the scene—he's the main character in the game
  • Include some of the other characters—perhaps positioned to give a new player a hint about some of the challenges in the game
  • Implement some animation or movement to the scene
  • Animate the Start button so that it grows when the mouse moves over it

The previous suggestions are the type of additional features that can really bring a game to life, immediately arouse interest in the game, and raise it from the realms of okay to excellent!

Research other games—what do they have in their introductory scenes to make them interesting and engaging to players before the game has even started?

The above suggestions have not been implemented in the sample game—this is a challenge to put into practice many of the skills that we have learned throughout this book. It's a great opportunity to review the various techniques that we have covered, and to consider how they can be used together to achieve different goals.

Note

Need help implementing some of the above suggestions? Visit the official Stencyl forums at community.stencyl.com. Before starting a new topic and asking for help, try searching the forums to see if other Stencyl users have asked similar questions and have already had them answered!

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

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