Discuss Scratch

searcher9000
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

The title basically describes it, I just don't know how to make it quicker then it already is? The number its at is 0.00000000001, and its still quiet slow, I need it faster. I am making a rotation for a sprite, (Its supposed to resemble a board game piece moving) and if anyone could share with me how to make it quicker, I would appreciate that.
JimboJones47
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

Could you share the project and add a link? I think it is something else in the script that's creating lag or you shouldn't notice the delay.
MathPuppy314
Scratcher
500+ posts

How do you make the "wait how many seconds" block quicker?

I'm pretty sure it's impossible to make the wait block run any faster than 0.033 seconds unless you specify zero seconds, in which case the block will not take any time. If there is any time set on the wait block, it will render at least one frame (at 30fps).

Instead of making the delay shorter, you should just change the step size of the movement.

Last edited by MathPuppy314 (Feb. 17, 2022 23:54:38)

searcher9000
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

JimboJones47 wrote:

Could you share the project and add a link? I think it is something else in the script that's creating lag or you shouldn't notice the delay.

I don't think its lag, I think its just slow because it rotates.
searcher9000
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

MathPuppy314 wrote:

I'm pretty sure it's impossible to make the wait block run any faster than 0.033 seconds unless you specify zero seconds, in which case the block will not take any time. If there is any time set on the wait block, it will render at least one frame (at 30fps).

Instead of making the delay shorter, you should just change the step size of the movement.


I gave that a try, it made it slightly faster, but not a huge difference
MathPuppy314
Scratcher
500+ posts

How do you make the "wait how many seconds" block quicker?

How much are you changing it by? Can you share the project?
AnUnkownScratcher
Scratcher
16 posts

How do you make the "wait how many seconds" block quicker?

You can't really do that but you could use a custom block, it can do run without screen refresh.
searcher9000
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

MathPuppy314 wrote:

How much are you changing it by? Can you share the project?

Sure, I'll unshare it once you've seen it
it will be on my profile

Last edited by searcher9000 (Feb. 22, 2022 18:53:46)

JimboJones47
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

Hi! I tried this and it looked good to me:

1. Removed all of the delay blocks.
2. Cut all of the repeat loop counts in half (changed from 10,20,10 to 5,10,5).
3. Doubled the angle of each rotation (rotate by 3 degrees instead of 1.5 degrees).

You could play with the numbers until you're happy with it, but I don't think the delays are helping.

Edit: So you have 2 forever loops in this project. When you have multiple forever loops, Scratch is going to be switching back and forth between the loops. Certain blocks are going to cause it to switch and give the other forever loop control. Delay blocks do that. If you add a delay, even for 0 time, it will give the other forever loop control again. All those delays are just causing the MOVE loop to run more, so your sprite keeps moving more than it is rotating. By removing all of the delays, you can let the rotate loop run more frequently and the move loop run less. Cutting down the number of repeat counts in your loops and instead rotating more each time will also help the rotate complete faster and the move loop run less.

Last edited by JimboJones47 (Feb. 23, 2022 00:22:13)

searcher9000
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

JimboJones47 wrote:

Hi! I tried this and it looked good to me:

1. Removed all of the delay blocks.
2. Cut all of the repeat loop counts in half (changed from 10,20,10 to 5,10,5).
3. Doubled the angle of each rotation (rotate by 3 degrees instead of 1.5 degrees).

You could play with the numbers until you're happy with it, but I don't think the delays are helping.

Edit: So you have 2 forever loops in this project. When you have multiple forever loops, Scratch is going to be switching back and forth between the loops. Certain blocks are going to cause it to switch and give the other forever loop control. Delay blocks do that. If you add a delay, even for 0 time, it will give the other forever loop control again. All those delays are just causing the MOVE loop to run more, so your sprite keeps moving more than it is rotating. By removing all of the delays, you can let the rotate loop run more frequently and the move loop run less. Cutting down the number of repeat counts in your loops and instead rotating more each time will also help the rotate complete faster and the move loop run less.


Thank you, I'll give it a try
searcher9000
Scratcher
100+ posts

How do you make the "wait how many seconds" block quicker?

JimboJones47 wrote:

Hi! I tried this and it looked good to me:

1. Removed all of the delay blocks.
2. Cut all of the repeat loop counts in half (changed from 10,20,10 to 5,10,5).
3. Doubled the angle of each rotation (rotate by 3 degrees instead of 1.5 degrees).

You could play with the numbers until you're happy with it, but I don't think the delays are helping.

Edit: So you have 2 forever loops in this project. When you have multiple forever loops, Scratch is going to be switching back and forth between the loops. Certain blocks are going to cause it to switch and give the other forever loop control. Delay blocks do that. If you add a delay, even for 0 time, it will give the other forever loop control again. All those delays are just causing the MOVE loop to run more, so your sprite keeps moving more than it is rotating. By removing all of the delays, you can let the rotate loop run more frequently and the move loop run less. Cutting down the number of repeat counts in your loops and instead rotating more each time will also help the rotate complete faster and the move loop run less.

I did all except your first suggestion, because when I tried, it made the Moose only move once and the key had to be pressed over and over. The other suggestions worked great, so thank you!

Powered by DjangoBB