Building a coin shop (part 1)

This is almost as easy as setting up ads. Just a few minor complications. First, set up your Coin Shop UI to look like this:

Building a coin shop (part 1)

The actual purchase buttons are made using the Purchase Button asset found in the Buttons section of the Asset Library. Before we can set these up, however, we must set up an action for the credit purchases to be linked to. And we mean literally an action on a game field screen. It doesn't matter which game field you go to, but we used the mars training ground.

Just drag in any graphic asset as an action. We used the Pause button graphic (so that we could easily tell what it was. Now that it's on the game field... delete it (by selecting it on the stage, and hitting the Delete key on your keyboard). Why? Because we want the action to exist, but we don't want it to be available during game play... only through a purchase. Set it up with the following settings:

Building a coin shop (part 1)

Now set up another one (we used the forward icon for the graphic) called HundredThousand with 100,000 Reward Coins. You may wonder why we used button graphics, and not a new unique graphic. First, as the actions are never displayed, there is no reason to make a new graphic. And second, reusing previously used graphics gives us the possibility that in the final compilation, there will be no additional resource cost (as it's another instance of the same graphic file). Let's go back to the Coin Shop UI.

Now, let's link up our credit purchase buttons to the actions in our game fields. Select the purchase button for the 10,000 credits, and make sure the settings look like the ones shown in the following screenshot:

Building a coin shop (part 1)

So, what we did here is select our TenThousand action from the game field in the Action Selection field. This links the reward. We also ticked our Buy and Use button (because we want the credits to go into their balance immediately). And finally, we selected In App Purchase from the Purchase Method drop-down menu. This all basically sets up everything we need to link this button to activate our action for a price. There's one more thing we'll have to do with this button (the Store Identifier field), but we're going to save that until we explain app IDs, and setting up your accounts for distribution channels. Leave this blank for now.

Do the same for the purchase button related to the 100,000 credit purchase (of course, linking it to the other action we created), and let's move on to our purchase button for removing ads.

Your settings for this button should look like the following screenshot:

Building a coin shop (part 1)

Adding video rewards

Video rewards are a great way to make money while not making your users pay for a single thing! Well, at least not with cash. Instead, they watch an advertisement and in turn, both you (the developer), and your player get a reward. You get paid, and your players get free coin rewards just for watching. Here's how it's done.

The first thing you'll need to do is go sign up for an account at HeyZap (http://www.heyzap.com). Once you sign up, just copy your publisher ID from your HeyZap account and put it in the Project Settings interface (for both your Google Play and iOS advertisements), as follows:

Adding video rewards

Now it's just a matter of setting up the button for the reward videos. Just like we set up the actions for our 10,000 and 100,000 coin buttons, you'll need to set up another action for the actual reward the player gets for watching videos. The bonus with this is that it completely bypasses the necessary entries in our distribution channels (which we'll cover in the next chapter) to buy items that we're selling. Instead, this is a simple transaction to watch an ad, so it's easy and quick to set up!

First, we replaced the Purchase graphic of our purchase button with one that reads Watch Video. This way the player knows they aren't buying anything. Then, (as we did with the other buttons), set the Action Selection to the one you just created to reward the player for watching the video. Once they've finished watching, they'll receive this reward instantly. Finally, in the Buy and Use section of the properties window, just set the Purchase Method to Reward Videos and the Ad Network to HeyZap. That's all there is to it! It should look like the following screenshot:

Adding video rewards

And there you have it! Our coin store is (mostly) complete. Only one more field to fill out for each purchase button as well as setting up our restore purchases button, and we'll handle that in just a bit.

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

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