"Wheel of Fortune" Sample

    Introduction

    This article will explain how to edit the different dynamic elements and values in the "Wheel of Fortune" sample experience. It will not explain how to edit the overall design.

    Wof_GIF.gif

    How it works

    When you press the “Spin The Wheel” button, the wheel image will rotate through 180 degrees three times - i.e. one and a half turns total - at progressively slower speeds and then rotate through an additional number of degrees determined by a Random From List interface asset. The list of possible rotational values is as follows:

    WoF_Random_From_List.jpg

    The values have been chosen based on the angle to which the wheel image should rotate to in order to win a prize. For example this is where the wheel will be at 21°

    WoF_21.jpg

    Or at 81°

    WoF_81.jpg

    If you change the image of the wheel with your own, you will need to find new angle values to set in the Random from list Interface Asset.

    After wheel rotation, the result needs to be defined. We used an Excel spreadsheet to define the value of the prize per angle offset of the wheel.

    Changing the wheel design

    Let’s say you want to replace the wheel’s design to this one.

    WoF_new_wheel.jpg

    You will first need to note down the different angles to which each section belongs. You can do so by playing with the wheel’s "Image angle" property in Composer:

    Wof_angles.jpg

    The result will be something like this:

    Wof_Angles_2.jpg

    Next, update the "Random From List - Lucky Wheel" interface asset with these new values.

    Then, open the Excel spreadsheet by right-clicking the "Wheel of Fortune - Values" interface asset in the Interface Asset panel and select “Edit in excel”:

    Wof_Excel.jpg

    Enter the new angle values and, in the “Prize Value” column, enter the prize amount you want to award for each section of the wheel. Save and close the Excel spreadsheet.

    Wof_Excel_example.jpg

    Modifying timing of sound effects

    You may have noticed that this experience triggers a winning sound when the user earns points and a losing sound when the user earns nothing. If you changed the angle and prize values, you’ll need to edit these triggers.

    If you select the button “Launch Audio Button” located below the scene (only visible in Edit Mode) you will note two triggers associated with it.

    Wof_Launch_Audio.jpg

    These triggers both have an “IF” symbol associated with them, meaning they are “conditional triggers” - i.e. they will only trigger if certain constraints are met. If you select the first trigger, you will see that the conditional trigger is:

    Wof_Conditionnal.jpg

    99 and 8 are the losing angles. These conditional triggers will play a happy sound and show animated confetti if the value of the "Random From List - Lucky Wheel" interface asset does not equal 99 or 8. Change these values to your own losing angle values. Use the same approach for the other trigger.

    In this case, if the "Random From List - Lucky Wheel" interface asset equals 99 or 8 then play the losing audio. Change these values to your losing angles.

    Wof_Conditionnal_2.jpg