[Solved] Where is my mistake?

Hey, I’m currently developing a mobile game for children.

Now, I wanted to add “Pairs” as one of the mini-games, and I followed the provided example-game.

So far, the cards are placed in the correct position, and I can reveal one card.

However, when I try to reveal the second card, the Tween animation briefly appears, then the second card becomes invisible and, from that point on, nothing can be done.

Here are three screenshots:

Part 1 of the code:

Part 2 of the code:

In-game error:

Thank you in advance for any help.

1 Like

The repeat event should be a child of the previous line. That line “filters” the cards. Grab the little blue box and slide it over one level to the right so it’s a subevent.

IDK if that’s the only issue. That’s the only one that I noticed because there was a condition without any actions or subevents.

Compared to the web version, this seems to be missing a couple of actions under “a pair was found”

Hello, thank you for your response.

So, I have corrected the Repeat event, but unfortunately, it did not make any difference. The same problem still occurs.

Regarding the missing actions under “a pair was found,” they are only necessary for the color of a text element that shows the pair count. However, my game does not have such a display showing the pair count, so these events are not necessary. I cannot imagine that this is the issue.

Nevertheless, thank you. Maybe someone else will notice another mistake.

1 Like

I would just keep comparing the events. Make sure there’s no typos in variable names (spelling and capitalization) or missing events. I don’t see anything in the screenshots. Maybe it’s somewhere else.

Okay, I’ve reviewed everything again and couldn’t find any discrepancies. The scene variables are also correct.

What surprises me is that everything works on the first card, but on the second card, the tween animation &sound works, but nothing happens afterwards. As far as I understand it, uncovering card 1 and 2 is triggered by the same events and actions, so I don’t understand why it works at the beginning but not afterwards. It shouldn’t work at all :confused:

Maybe I made some beginner mistake, as I’ve only been using GDevelop for about 2 weeks.

If anyone has any suggestions, I would greatly appreciate it.

Your indentations are too far to the right; the events with the red shading are subevents of the game_state = "player_turn" event - they should be level with it:

From the web version:


1 Like

Thank you for your help! :slight_smile:

That was really the mistake, everything works now. I completely overlooked it.