Awarding trophies
This tutorial will guide you through the process of awarding and activating trophies for your game.
Note: Once you add a trophy to the Trophy Sources tab in the game editor, you cannot delete it.
Coding the Trophies
In order to award trophies, you will first need to make the appropriate Trophy award calls in your code. In this example, we are awarding 3 trophies. Of course, in your code, you would be awarding trophies as appropriate and most likely not all together.
<actionscript> //Where _control is an instace of the GameControl Object //And the string argument (i.e. "bronze") is the identifier for the trophy and not the name.
_control.player.awardTrophy("bronze")
_control.player.awardTrophy("silver")
_control.player.awardTrophy("gold") </actionscript>
Uploading the Trophies
After you have listed your game with the trophy calls, you should then create your trophies.
- Choose Games → My Games to see the Games you own.
- Click the Edit link under the name of the game you want to make a trophy for.
- Select the "Trophy Sources" tab.
- Click on the "Create" button to get the trophy source creation interface.
- Click on the Name field and enter a name for your trophy. This is the name that is displayed under the trophy image on a player's trophy page.
- Click on the Identifier field and enter an identifier for your trophy. This string is used to identify this trophy in your game code. For the example code shown above, the trophy source identifiers are bronze, silver, and gold.
- Click on the Order field and enter a number. This number will be used to sort your trophies into a particular order on your game's detail page, lowest to highest.
- Check Secret if you wish for the description the trophy to not be shown until the player has earned the trophy themself.
- Click Upload a new file in Trophy Image and find the image file for your trophy (png, jpg or gif; max. 60x60). This is the image that will be seen on the player's trophy page when they win it.
- Click on the Description field and enter a description of your trophy. This is only required if you plan to sell it in the shop.
- Confirm that you own the copyrights to the item or have authorization to upload it.
- You can then click on Save to add your trophy source to the Trophy Sources tab.
Once all the desired trophies have been created, the trophies should be shown on the Trophy Sources tab. The trophies are not yet active at this point.
Activating the Trophies
To activate the trophies, you will need to publish them. For each trophy source, click to "list" the trophy so it is added to the Shop. The trophies will not be visible items in the Shop.
If completed successfully, the trophies will be accessible to the game. Your public game information page will be similar to this:
Please Note: Once a player has earned a trophy for their profile page, it cannot be removed. Furthermore, the artwork for the trophy on their profile page will not change even if the source artwork for the trophy is updated at a later date. Make sure you are comfortable with the artwork and the conditions for earning the trophy before activating them.
Testing the Trophies
That's it! You are done. Whirled will take care of automatically incorporating your trophy artwork into your game wherever you have called awardTrophy(). Once you have fully incorporated trophies into your game. Please play your game and make sure the trophies are being awarded at the correct time.