Score for special click

i make a game educational, kid has to choose the right pic from multi choices, I want to score every right click of him, pictures come in groups, after first 4 pics there are another for… etc
many tutorials explain score but for one object collect coins, But here I want to do that for every pic.
i need a help please.

You can do for each scene
Cursor or touch is on right_picture
Add player.variable score 1

sorry i didn’t understand

This is what I mean. This may do the trick.

thank you
but i have a picture as ( Gun) and a text as ( score )
what is ( player_1) plays ? i can’t know what will be instead of him in my game
And this condition will act with touching not click
i want to edit a code for clicking
sorry for my many questions

There are many ways to do this, but they all involve being able to identify, in the events, which image is correct.

For example, say the question was “Which one is the dinosaur”. I would consider having a sprite or each groups of answers, with 4 animations and give the correct one the name “Correct”. In this example, I’ve named the sprite “Question1_pictures”:

To display them you’d create the sprite, and then change the animation number. Here I’m setting them up in a row at the start of the scene:

In the events, if the mouse is over a sprite, the mouse is released and the sprite’s animation name is “Correct”, then update the score or whatever you like to do in the actions.

1 Like

thank you i will try it and tell you

i didn’t find these conditions:
-while this condition is true

  • the scene variable …
  • Repeat these
    how can I write these conditions?

Repeat these? Its in the Top-Right corner:
The scene variable, search for it. A search bar is available:

in this action

why it gives me ( 05555)?

yes i found them but i want to know why score gives me ( 05555 ) not one five?

Because every time GDevelop loops through your events, the conditions are true and it triggers the change in text. Use Mouse is released instead, or a trigger once condition.

great i used trigger once and mouse released
now when i click the pic gives me ( 5) but i click again it give me score againe\and it gave me it beside the previous one, like that
55 etc

Well, yes, that’s what you’ve programmed. If the mouse is on the banana, the mouse is released then add 5 to the text box.

The trigger once doesn’t mean only do it once ever. It means only do it once while the condition is true. As soon as the mouse is no longer released, or it isn’t on the banana, then the condition becomes false, and the trigger once resets for that event.

But i want the kid press the banana one time otherwise he click it again and again to win points
And due to score my issue now is that the score which is ( 5 ) points come as a matrix i mean at a line ( 5 beside 5 ) for any click of other pics. You sure know that it will be a lot of questions and every question has a correct pic. please i want to go ahead in my game this issue stopped me for 2 days now< help me

this is my pannel and other pic for yhe game and the score by clicking the correct pic: many fives appear, please help

You can add 5 to variable and change the text to variable

strings can not perform mathematical actions.
A + in strings means add this to the end.
1+1 in a value = 2
“1”+“1” in strings = 11

sorry i couldn’t
if you - please- teach or show me how.
what variable to add 5 to?
what text ti change?
and how

And when i delete ( " ) the app see it a wrong action

This is what I meant:

you should modify the variable and not the text
after that change the text to variable