"Scratchcard Game" Sample

    Introduction

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

    Simple Scratchcard

    Scratcard_gif.gif

    In this scene we use a Random From List interface asset to choose a point value for the winner. If you look at the properties of the interface asset “Random From List - Scratchcard”, you will see all possible point values. You can change them to the values of your choice.

    random_from_list_properties.jpg

    This interface asset is set to change its value whenever the "Try Again" button is pressed.

    Multiple Item Scratchcard

    Scratcard_2gif.gif

    This example is a bit more complex as we use different interface assets to handle the logic behind this game.

    How to use different images in the scratch cards?

    To edit the images and replace them with your own you will need to open and edit the Excel file referenced by the Excel interface asset. It’s this Excel spreadsheet that serves as a data feed for the 8 scratch card items.

    1. Right-click the “Scratchcard Combinations” Excel interface asset in the Interface Assets panel and select “Open file location”.
      excel_scratchcard.jpg
    2. Go into the “Images” folder and replace the images with your own. Use the names of the original images if you want to avoid editing the spreadsheet itself.
      excel_folder.jpg Scratchard_images.jpg

    3. [Optional] To change image names, right-click the “Scratchcard Combinations” Excel interface asset in the Interface Assets panel and select “Edit in Excel”. Update the file names everywhere they appear.

    How to change the order of images displayed

    An image order is selected randomly from 120 possible combinations. You can edit/remove existing combinations or add your own.

    1. Right-click the “Scratchcard Combinations” Excel interface asset in the Interface Assets panel and select “Edit in Excel”.
      excel_scratchcard2.jpg
    2. Change/delete existing rows and/or add new rows
    3. If the total number of rows is modified, change the "Maximum" property of the “Number Generator - Scratchcard” interface asset to match. For example, if you change the number of possible combinations to 30, you will need to update the "Maximum" property value to 30 to ensure a blank row is never referenced.

    Number_generator_scratchcard.jpg