ActivePresenter Saola Animate Pricing Download

Creating a 'tremory' game

Dear support team,

inspired by the memory game sample I want to create a ‘tremory’ game which demands the player to find not just two but three matching cards.
I read the advanced action tutorial but don’t know how to modify the advanced action of the memory game so that it works for three cards. Can you help me with that, please?

This is what I have done in analogy to the memory game so far:

Kind regards, Alketas

ActivePresenter version: 8.5.0

OS: Win 10

Hi Alketas,

You can take a look at the attached sample for your reference: memory-game.approj (1016 KB)

Please perform the following steps in the Advanced Actions dialog:

  1. In the Parameters section, add some Control State and Shape parameters.
    It depends on how many cards you want to work with.

  2. In the Actions section, add Hide Object action using the newly inserted Shape parameter:

    image

  3. Change the condition to adjust variable:

    image

Regards,
Hoa

1 Like

Dear Hoa,

thank you very, very much!

Regards, Alketas

Hello,

if I want to use 18 cards in the game, how many Control State and Shape parameters do I need? Or does only matter that the player needs to find three matching cards?

Regards,
Alketas

Hi Alketas,

Could you please clarify your question? Do you want to have 18 matching cards or 18 cards for 6 different types?
In the first case, you must have 18 parameters. In the second case, you just need to use parameters like in my example.

Regards,
Hoa

Hello,

sorry, my fault. There are 18 cards in total in the game, being of 6 different types (so each type consisting of 3 matching cards).

Thank you!

Regards,
Alketas

Hello Hoa,

the game works, thank you!

However we found a change in rules would make it even better:
We want the player to pick three cards. Meanwhile the cards should not flip back. If the player has chosen three matching cards, they should vanish as before. If they do not match, the three cards should flip back into normal state after 3 seconds.
After either outcome, the player may pick three cards again.

I tried to realise this by using a ‘ClickCount’ Variable (Number) which adds +1 in the Advanced Action. But I struggle as I don’t have much experience with Advanced Actions yet. Can you help me once more?

Hi Alketas,

In this case, you should use JavaScript as in the attached sample: memory-game-js.approj (800 KB)

When adding a new card, you need:

  1. Name states of a card: Normal and Flipped states.
  2. Update the JavaScript code in the On Load event of Slide:
    // update group names
    groups: ['Rabbit', 'Frog'],
    For example, if the card name is Pig, the JavaScript code becomes:
    groups: ['Rabbit', 'Frog', 'Pig'],

Regards,

1 Like

Dear Hoa,

thank you so much, this helps a lot! You are amazing!

Best regards,
Alketas

Hi Hoa,

I have one more question: how can we adjust the time until the cards flip back and collapse out? We would be happy if there was a delay of 2 or 3 seconds.

Regards,

Hi Alketas,

You can change this by updating the JavaScript code at: flipBackTime: 1000, // ms

Regards,
Hoa

1 Like

Dear Hoa,

thank you once more! Is there a way to also delay the time until the cards collapse out, so when having chosen three matching cards? Can I just put in a line like ‘setTimeout(() => 2000);’ ?

Regards, Alketas

Hi Alketas,

Please check this sample:
memory-game-js-2.approj (768 KB)

You just need to update flipBackTime option, it’s used for both correct and incorrect cases.

Regards

1 Like

Hi Hoa,

thank you!

Regards,
Alketas