Personal tools

Awarding prizes

From Whirled

Jump to: navigation, search
The Prizes tab for a game.
This tutorial will guide you through the process of awarding and activating prizes for your game.

Note: Once you add a prize to the Prizes tab in the game editor, you cannot delete it.


Contents

Coding the Prizes

When you want to award a prize, just call _control.player.awardPrize(ident), where ident is the identifier you set below.

You can award prizes at the same time as trophies by doing something like this:

Because a game can award the same prize more than once if the player earns the prize in separate game sessions, a game that wishes to only award a prize once should couple the award of the prize with the award of a trophy and then structure their code like so:

//Where _control is an instace of the GameControl Object
//And the string argument (i.e. "special_award_avatar") is the identifier for the prize and not the name. 
 
     if (_ctrl.awardTrophy("special_award_trophy")) {
         _ctrl.awardPrize("special_award_avatar");
     }

To simultaneously award a prize with a trophy, the code looks like this:

//Where _control is an instace of the GameControl Object
//And the string argument (i.e. "prizeone") is the identifier for the prize and not the name. 
 
if(!_control.player.holdsTrophy(trophyone)){
    _control.player.awardTrophy(trophyone);
    _control.player.awardPrize(prizeone);
}

Creating Prizes

After you have listed your game with the prize calls, you should then create your prizes. First, you need to upload an item that will be your prize. List the item in the shop (can be hidden) and take note of the item's shop ID (http://www.whirled.com/#shop-l_5_347 has 347 as its shop ID). The item that is used as a prize needs to be uploaded & listed by you.

  1. Choose Games → My Games to see the Games you own.
  2. Click the Edit link below the name of the game you want to make a prize for.
  3. Select the "Prizes" tab.
  4. Click on the "Create" button to get the prize creation interface.
    Prize creation interface.
    1. Click on the Name field and enter a name for your prize.
    2. Click on the Identifier field and enter an identifier for your prize. This string is used to identify this prize in your game code.
    3. Use the dropdown menu in Prize Type to indicate what type of item your prize is. It can be: Avatar, Furniture, Backdrop, Toy, Pet, Launcher, Level Pack, Item Pack, Image, Audio, Video, or Prop.
    4. Click on the Prize Shop ID field and enter the shop ID number. For example, http://www.whirled.com/#shop-l_5_347 has 347 as its shop ID.
    5. Confirm that you own the copyrights to the item or have authorization to upload it.
  5. You can then click on Save to add your prize to the Prizes tab.

Once all the desired prizes have been created, the prizes should be shown on the Prizes tab. You will need to click "View" for each prize and "List item" in order to publish them so they are accessible by your game. The prizes will not be visible items in the Shop.

See Also