olejika

https://dropmefiles.com/SDoz3

Anagrammer works to slow. Please help me

deck26

Please share the project on Scratch.

olejika

Here's the project. I didn't share the project before because i don't like Scratch 3

https://scratch.mit.edu/projects/321206912

a-jar-of-tuna

I don't see any lag. Is it that the anagram thing takes too long to generate? That should be something in the code (i.e. a small wait block when the letters are appearing), so you should know if you added that feature or not. Can you describe where it is taking too long?

a-jar-of-tuna

If you want to reduce the generation time on the letters, try changing the code so that when you click on a letter, it doesn't redraw all of them, it only delete one. Then, to make the letters on the top load faster, make it load before or during the 4x4 letters generation. If it calls for after, it would have a delay because it has to wait for the ones on the bottom to load.

olejika

a-jar-of-tuna wrote:

Try changing the code so that when you click on a letter, it doesn't redraw all of them, it only delete one
It's impossible because ‘delete this clone’ deletes only the last clone, and I can't choose one to delete.
Stamps are not a good choice either, since this way it's impossible to identify witch tile is pressed.

StrangeMagic32

olejika wrote:

a-jar-of-tuna wrote:

Try changing the code so that when you click on a letter, it doesn't redraw all of them, it only delete one
It's impossible because ‘delete this clone’ deletes only the last clone, and I can't choose one to delete.
where did you learn this?

delete this clone deletes the clone that activated it

a-jar-of-tuna

StrangeMagic is correct, would you like me to create a remix if this is confusing you?

a-jar-of-tuna

I created a remix -> https://scratch.mit.edu/projects/321245164/
that fixes the slow generation by removing only the clone clicked and preventing a total redraw. It should work fine now.

I explained the reason for a long script in the comment next to it.

Happy coding!

olejika

Thanks for trying but now entering words is impossible and buttons ‘Enter’, ‘Reset’, ‘Scramble’ and ‘Custom’ don't work anymore.

TheLegoGuy_TESTS

I'm not too sure what's going on here, but I'll give you a tip, to speed things up. Create a custom block and tick the run without screen refresh box, then put all the code under there. Sorry if I didn't help.

a-jar-of-tuna

Oh yes.. I see now.

I think it's that the rest of your code relies too heavily on the regeneration every time something is changed. So if you want to remove the slow generation, you basically have to restructure everything else to make them work. Maybe you can try the suggestion I gave above about preventing the grid regeneration and adapting the other functions of the game to make it work (since you know your code best)?

olejika

Thank for help. I just realized that the only way to increase the speed of Anagrammer is to delete all tiles.
But to do that I needed to add if statements so it make clones slower.

https://scratch.mit.edu/projects/321336609/

There's no prefect answer to this. So, thanx for trying.

Scratch-Coding

Try to put the project in turbo mode.
Click the green flag and hold Shift