When I run the project in the emulator, the program functions normally from the first to the third playing, but when it gets to the fourth, either the project will stop the sounds I've added on each button. and then it will stop suddenly. My code has no warnings or errors.
My goal is to run this project smoothly without any errors. I only use LDPlayer to run my APK.
You should especially make sure that you switch screens correctly. Otherwise, a memory problem can occur and the app will crash (since screens have been opened too often).
They should be on a Player component instead of the Sound component.
Also, Screens do not like to be switched while music is being played.
They require such operations to have been completed before trying to switch screens.
Fortunately, the Player has blocks to stop playing.
you are trying to get the score from another screen using the get start value block. However for this to work you have to pass that score from the other screen using the open another screen with value block...
also usually you use the get start value block during initializing of the screen and not during definition of the global variable...
alternatively use TinyDB to pass information from one screen to another, see also tip 1 here