Time for action – inserting an advertisement into our game

Before proceeding, ensure that the final, ready-to-publish version of the game is open in Stencyl.

  1. Open the Main Menu scene.
  2. Click the Events button at the top of the Scene Designer screen.
  3. Click +Add Event | Basics |When Creating.
  4. Rename the event to Display Mochi Ad.
  5. In the instruction block palette, select Game | Flash.
  6. In the Mochi section of the palette, locate the show ad with size (w: 0, h: 0) block and drag it into the new when created event.
  7. In the new show ad with size (w: 0, h: 0) block, change the w: entry to 640 and the h: entry to 480.
  8. Ensure that the new event appears as shown in the following screenshot:
    Time for action – inserting an advertisement into our game
  9. Click on the Settings icon in the main Stencyl toolbar.
  10. Select Web in the list of options in the left-hand side panel and ensure that the Services option is selected at the top of the main dialog box panel.
  11. Accurately enter the unique Game ID into the Mochi Game ID text box and click OK.
  12. Test the game. When the game loads the following message (or similar) will be displayed:
    Time for action – inserting an advertisement into our game
  13. Click on the Play button, in the lower-right corner of the game's screen, to play the game.

What just happened?

We have successfully implemented the MochiAds advertising instructions in our game, and the message has let us know that our game has correctly communicated with the MochiAds servers.

The first step was to create a new when created event in the Main Menu scene. We then added the instruction block that displays the advertisement, but we needed to specify the size of the advertisement, so we provided the correct dimensions of our game—640 pixels wide and 480 pixels high. Providing the correct dimensions ensures that the advertisement will completely fill the screen, and failure to provide the correct information may lead to inappropriately sized advertisements being placed.

Once we had the Mochi Ad instruction block in place, we needed to let Stencyl know the unique Game ID, so that it can be passed to the MochiAds servers each time an advertisement is displayed. The Game ID was placed into the Mochi Game ID text box, in the Web section of the Stencyl Settings dialog box.

We're nearly at the stage where we can start being credited for each advertisement that is displayed in our game, but there's a little more work required to configure our game in the Mochi Media Dashboard.

Have a go hero – finalizing the MochiAds configuration

We haven't provided enough information for Mochi Media to start displaying real advertisements in our game and to start being paid, so sign in to the Mochi Media website, display the overview page for your game, and click on the Activate NOW! button under the Ads heading.

The page that will be displayed will take you step by step through completing your game profile, uploading your game, and having it reviewed by a member of the MochiAds team to ensure that it meets the required standards.

Before Mochi Media can transfer any money to you, you will also need to provide some payment details. Note that payment information does not need to be provided immediately—Mochi Media will continue to credit your account and will hold payment until the required information has been provided.

The Mochi Media review process

Mochi Media needs to ensure that advertisements are only displayed in appropriate games, so a Mochi Media employee will check your game to make sure that it works, and that the content of the game is appropriate for the target audience. As long as your game is playable, is of a reasonable standard, and does not contain obvious bugs, your game should be accepted within approximately 24 hours of correctly completing the game profile.

Note

The Monkey Run game, exactly as developed throughout this book, was submitted for review and was accepted into the MochiAds program within 24 hours.

Preloaders and advertising

While this book has primarily been designed to be used with the free version of Stencyl, it should be noted that the subscription versions of Stencyl that output Flash games include the ability to create a custom preloader —the graphics and progress bar that are displayed as the game is loading on a web page. One of the custom preloader options provides the facility to display advertisements while the game is loading. This provides a more professional impression of the game and is accepted within the gaming community as an acceptable method of displaying advertisements without interfering with, or slowing down, the player's entry into the game.

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

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