Random audio play on multitouch button click.....?

Hello guys…I have one question or better saying I looking for solution about game I want to make for my kid…

I have on left side speaker button and on the right side small sprite images like: fish, horse, cow etc…
My idea is when I press speaker button that game choose random sound, and by each next click to play again random sounds like (fish, horse, cow…)…And if last sound was “fish” and when kid click on fish image that image disappear , otherwise if he click on wrong image to get message that is wrong…Idea is that game memorize id of last sound and compare with matching id of image…For instance fish.ogg and fish png…I was also thinking that game do not repeats sounds which already matched with images…

I break my head already whole day with that…I could to make speaker button to play random sound but only once, if I click again on button nothing happens…I guess that what I want to do is very difficult!..But anyway I ask you guys because I believe in your knowledge…

Greetings!

put your animal sprites in a group. (group animal in my example)
then give each sprite a variable with its name or number in it. (variable(id) in my example)

and thats basically the full game.

if you want to reset the animal, after picking wrong do this:

the red circle arrows means the condition is inverted, means NOT. you can also invert your conditions by right clicking it and choose invert.

Dear Slash…Thank you so much for your time and your effort to help me!!!..You have no idea how much I appreciate that!..I knew that you guys are great and that you always have some idea…I learned some things about variables, but when I see how you think and how you use that, trust me I simply admire you!..I was thinking that my crazy idea about that kid game is impossible mission, but I was wrong…You made my day!!!

Soon when I get some free time to test all of that I will come back to you to tell you how that works for me…It is just question if I can implement all of that in correct way like you explained?..

Anyway, thank you so much once again, and God bless you!

Best regards,

David

Have a shot at it. If something doesn’t work, ask again and share screenshots of your events.

Dear Slash,

I will come bask to you if something does not work…But so long how much I could to see in your variable steps I believe that it gonna work…Anyway if I stack somewhere I will come back to you!..

Thank you so much!!!

Best regards,

David

Dear Slash…I tried your solution but nothing happened…When I click on speaker game do not play any sound…How much I could to understand your variables, I did not see that there are any call for random audio play…Maybe I do not understand well procedure of your variables?..I am not so good in that!

here are some shots…



Best regards,

David

Here are some shots of group and sprite variable…


i assume, the scene variable id sets to 0 instead of “”
try to add the action
change the text of variable(id) to “”
to the at the beginning of the scene.

you also do not play your sounds on channel 1

edit:
Also its best to replace the “mouse/touch is down condtition” to “mouse button was released”, to avoid an immediate second click on the last animal, when the scene restarts. then you can also remove the trigger once there.

I tried everything like you said, but still nothing happened…No sound when speaker is clicked…

i just tried it, and it works.

make sure, all your animals have the id

Dear Slash…Thank you so much!!!..It works like charm…Works great…I went through your variables and I still can not to figure out logic how you did that, definitely I am not smart enough for that . I really admire you!..Thank you thousand times for your time and effort!..You are really great…

God bless you!

Best regards,

David