May 10, 2021
Captivate 2019 – memory game with advanced actions and javascript
Comments
(4)
May 10, 2021
Captivate 2019 – memory game with advanced actions and javascript
Newbie 1 posts
Followers: 0 people
(4)

I’m working on a memory game using captivate 2019. I have managed to create items, make them flip when clicked (applying effects), and created variables to use advanced actions. I can’t find the way to check for matching cards and shuffle items when a new game starts. I thought of adding javascript, but then comes the challenge of using HTML and CSS. Has anyone done a memory game with captivate 2019 combining advanced actions and javascript?

4 Comments
2021-09-08 22:18:09
2021-09-08 22:18:09

Thank you so much Greg.

Like
2021-05-12 09:29:13
2021-05-12 09:29:13

You can find a complete workflow with one shared action and one Reset advanced action in this blog:

Memory game (shared actions) – eLearning (adobe.com)

Like
(4)
2021-05-10 13:05:40
2021-05-10 13:05:40

Same question as in this thread on the Adobe forum:

https://community.adobe.com/t5/captivate/captivate-2019-memory-game-with-advanced-actions-and-javascript/td-p/12025552

You got some answers there already, but didn’t answer.

Like
(3)
2021-05-10 12:52:50
2021-05-10 12:52:50

I responded to you in the Captivate forum but will paste the response here as well.
Please excuse any formatting issues.

Perhaps this will help get you started.

You will need several variables to do this.

I would use two variables to track which of the two turns is active (firstPick and secondPick) and two more to store the values of those selections (tileValueA and tileValueB )

You will also need a variable that tracks the current selection in order to transfer it to the variables that will be compared.

Suppose you have a 4×4 grid of 16 tiles to play.

Each tile will have a pickValue from 1 to 16.

Each tile will have a tileValue as well but there will be 8 matches – two of each value.

Maybe you have a picture of a bird on two of the tiles – the tileValue might be set as “bird” for tiles 3 and 11.

 

tile 3

pickValue=3;

tileValue=”bird”;

setValues();

tile 11

pickValue=11;

tileValue=”bird”;

setValues();

 

The selection process might look like this

The user selects the first tile… code runs

if (firstPick==0) {       // checks to see if the first pick has been made – in this case -NO

firstPick=pickValue;   // because our variable was 0 – this will now be set to 3

tileValueA=tileValue   // the tileValueA variable will now match the value of the selected tile “bird”

}

// when the second choice is made, the firstPick value will not be 0 so this will run

else {

secondPick=pickValue;  // our second pick is now going to be set to 11

tileValueB=tileValue;     // our tileValueB can now be set to “bird” as well

}

compare();    // this is a function to see if tileValueA is equal to tileValueB

In this function, you will want to either flip the tiles back over for a non-match or remove them from the game board if they are. I would also take the script logic for tile selection and value setting and make it a function to minimize your code.

 

If you wish to randomize the gameplay – it gets a little trickier as you need to find a way to randomize the tile backs.
I would suggest using some arrays in the background for that.

 

Here are a couple examples – both of which have randomization for endless playability.

The first is strictly Memory – it has a visual shuffling element

https://elearning.adobe.com/2019/10/memory-game-part-1-chemmem/

 

The second project has a memory game a few slides in.

It is randomized but no visual shuffling.

https://elearning.adobe.com/2021/03/temperature-conversions/

 

Both are advanced level Memory games rather than the traditional picture match.

 

Anyway – hopefully this gives you something to chew on.

Like
(3)
Add Comment