Discuss Scratch

supremeitor
Scratcher
6 posts

Proyect runs very slow.

Hello, I am searching for help. My proyect, when i played it, runs very slow. More less is like it have lag or something similar.
I tried to put turbomode but i doesent work. I can put de link of my proyect so you see the proble.
Can somebody help me please?

Last edited by supremeitor (Aug. 29, 2023 19:16:27)

Link2358
Scratcher
100+ posts

Proyect runs very slow.

Lag can be caused by many things, such as:
  • Including wait blocks inside run without screen refresh custom blocks
  • Running unnecessary code (e.g. attempting to draw X tiles when only Y are visible at once)
  • Having similar scripts instead of condensing them into a custom block
source i guess
You can fix lag by just not doing the above. Although there can be more specific reasons for lag, I would recommend sharing your project if your lag persists
supremeitor
Scratcher
6 posts

Proyect runs very slow.

Thank you, here is my proyect.
https://scratch.mit.edu/projects/886621479
Its supose that the ball bounce with the efectt of gravity, but in my case the ball goes with lag.

Last edited by supremeitor (Aug. 29, 2023 20:16:11)

Link2358
Scratcher
100+ posts

Proyect runs very slow.

supremeitor wrote:

Thank you, here is my proyect.
https://scratch.mit.edu/projects/886621479
Its supose that the ball bounce with the efectt of gravity, but in my case the ball goes with lag.


The reason why your project is lagging is because the “costume2” costume is too close to the center, and that it is not being set as the costume.
To fix this, go into “costume2” and move the ball right until the left of it is on the center:

Edit: after this zoom all the way out, then select the ball and press right twice

To then fix the second issue, go into the “Find normal” custom block, and change the “switch costume to ‘costume1’” to “switch costume to ‘costume2’”:
define Find normal
switch costume to [costume2 v]
. . .

Last edited by Link2358 (Aug. 29, 2023 20:27:04)

NMario84
Scratcher
1000+ posts

Proyect runs very slow.

I was about to say……. WHY would it matter if the ball is positioned exactly center, or you offset it entirely to the right as such? Then I watched Griffpatch's video. It seems he uses another costume for the ball that requires this detection process.

So, if they're following the ball physics tutorial from Griffpatch, then from what I saw there, he uses 2 ball costumes in the video. 1 for the actual sprite being displayed (assuming it's positioned exactly center), and another costume is detecting the wall collisions, which is the offset sprite. Though the project here, I only see 1 ball sprite being drawn.

Maybe perhaps try to go through the video again, and see what went wrong, and why 2 costumes are being used.

Last edited by NMario84 (Aug. 29, 2023 21:17:15)

Powered by DjangoBB