Need help to optimize my blocks

If you are using for each item block, then you should not use direct index here, then there is no use of the block. You need to try to find the index by using index is in the list thing( item ) lost get gKobal answer button.

Actually what are you trying aar here, you news to add the colour only here…

You need to replace the item with select list item list (get global button) index (index is in the list thing (component ) list (get global answer button)

But this index is linked to my custom color list, it’s to avoid having color building blocks every time, so it doesn’t relate, does it?

Ok ok, i got it. Pls try to change the item only as said above

I don’t understand what you’re asking me to try, change what, please?

Ok, pls have a look at this post and developers your idea for color change

It is exactly the same problem. I really do not understand. I really need help please :confused:

It would be easier if you provided a test aia

Watch the video, normally there is a sound for the correct answers, and a sound for the wrong answers (and in addition a vibration when it is wrong).

No matter what answer I choose, I have both sounds playing at the same time and the vibration too, and no matter which button I click, it’s the same, even if I click on the “Pause” button in bottom of the screen

I’ll try this, okay

So, I quickly reproduced the situation on this aia test.

You have to refresh to start over, but I have the same problem as on my project.

No matter which button you press, both sounds are played, and even with buttons that are not in the list, like the test button at the bottom.

test_btn.aia (99.6 KB)

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