The “Memory Game” sample relies upon a custom-built interface asset (IA), written in JavaScript. This IA – named MemoryGame - implements logic to do things like prevent the display of a third image if two non-matching images are already displayed. In addition, the images used in “Memory Game” are dynamically loaded by this interface asset. In order to change these images, proceed as follows:
- Download the “Memory Game” sample to your PC and save a local copy.
- Locate the “Images” folder associated with the MemoryGame interface asset.
Using File Explorer, navigate to the local copy of the “Memory Game” sample. Then, in the project folder, navigate into the folder Files\InterfaceAssets\MemoryGame\Images. For example, the path on your PC may beC:\Users\[YOUR USER NAME]\Documents\Intuiface\Memory Game\Files\InterfaceAssets\MemoryGame\Images
- Replace the images in this Images folder with your own. Add as many images of any size as you like. The experience will automatically create 2 cards for every image found in the folder, like in this example:
Set of matching cards
You can also have a trigger based on a pair of matching cards
When selecting a card, you will first have to throw the identifier of the selected card to a text asset outside the data feed. Then, you will be able to rely on the text value for creating a conditional trigger on the Memory Game IA.
For example:
WHEN - button is pressed - THEN - set text (the value should be bound to the Memory Game IA - Each item of the CardList datafeed Card Value)
Please note the text asset must be outside the DataFeed so it may be accessible for the following trigger/action (if nested in the datafeed you will not be able to target it) :
WHEN - Memory Game selected cards are matching - IF - Text - Equals (value of your card) - THEN - action
You will have to multiply this conditional trigger for each set of cards.
NOTE: If you are looking to have multiple Memory Games in a single experience please refer to the example in this community post.
Comments
0 comments
Article is closed for comments.