Need help to optimize my blocks

Try adding a If not Already Handled condition and moving the whole procedure into it.

I replaced all the “item” block by the “component” block, it works for the sound, but I still have the problem of the button which is not in the list.

And when I clicked on a wrong answer, I liked that the correct one would turn blue (without playing the correct sound)

Like this ?

blocks(20)

It dosnt work :confused:

Ok, this should’ve corrected the problem of the button which is not in the list.

Maybe you’ve already done that, but let me ask you if the pause button and/or the other buttons not in the list have all been handled.

All of my screen buttons have actions, the Pause button pauses the game and displays options, the Quit button stops the game, etc.

You can try with the aia file that I have prepared for testing

https://community.kodular.io/uploads/short-url/mIkMnm9qRRphndtlswJ9WfqQmOr.aia

It worked like this for me.
test_btn.aia (100,1,KB)

3 Likes

Or this

test_btn_1.aia (100.2 KB)

1 Like

If I click on the Test button at the bottom, it changes the color too, while it is not in the list

Edit : Sorry, not for you Fabio, but for Dora

It happens because in the Test AIA the test button is not handled.
In my case I’ve handled it so it doesn’t follow the any button procedure.

Wait … Simply because the “When button 5 click” block is on the page, without any block inside, it works ??? I admit I don’t understand why, but it works.

I will try to reproduce this on my project, and I hope it will work

No it doesn’t

Yes, because when you place the block on the page it means you’re handling it and the any button procedure recognizes it.

:face_with_monocle:

@Fabio 's version works perfectly on my project, a huge thank you!

And thank you very much to you too @dora_paz , you are often present to help me and that makes me happy!
And thanks also to @Still-learning for taking the time to try!

2 Likes

Hey @dora_paz @Still-learning @Fabio , if you’re interested, you can try my quiz! Well, it’s completely in French, so you won’t understand anything, but to try the mechanics and tell me if you encounter any bugs! Thanks to you, I was able to optimize a good number of blocks ^^ Thanks again!

QuizzDepartements.apk (9.0 MB)

Sorry for the delay… May i share my view regarding your query?

I am having different view

With pleasure, because all the solutions are good to take to evolve!

Great ! Works great too! With a different method but maybe with a little more block than the other methods. Thank you !

Thanks… Now slightly adjusted for wrong answers, there by users will be able to see what they clicked but actually what is the correct answer. Just for learning… Thank you…

test_btn1(2).aia (100.9 KB)