Discuss Scratch

EpsilonXTest
Scratcher
7 posts

Game optimization

The game: https://scratch.mit.edu/projects/1229465781/
The problem: the collision script takes to long too run. The current script runs like this:
sprite: Ball
if <touching [Blocks v] ?> then
broadcast [check if touching ball v] and wait
end
sprite: Blocks
when I receive [check if touching ball v]
if <touching [Ball v] ?> then
change costume
end
However, this takes far too long to run. Any help would be appreciated!
Note: both of these scripts are running in clones, not the actual sprites.

Last edited by EpsilonXTest (Oct. 15, 2025 21:46:51)

RokCoder
Scratcher
1000+ posts

Game optimization

Using a broadcast and wait block within a non-refresh custom block causes the lag. You['re doing this in your Tick custom block in your Ball sprite.
EpsilonXTest
Scratcher
7 posts

Game optimization

Thanks! I didn't even think to check that. It works fine now.

Powered by DjangoBB