Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Shortening Scripts
- BlueBionicWhale
-
Scratcher
61 posts
Shortening Scripts
Link to project: https://scratch.mit.edu/projects/544717742/
Is there a way to shorten the scripts in sprites ‘Food Smasher!! Title Screen Continue Button’ and ‘Food Smasher!! Title Screen New Game Button’?
Is there a way to shorten the scripts in sprites ‘Food Smasher!! Title Screen Continue Button’ and ‘Food Smasher!! Title Screen New Game Button’?
- Yusei-Fudo
-
Scratcher
1000+ posts
Shortening Scripts
Of course! That's all I can think of off the top of my head.
“Food Smasher!! Title Screen” Sprite
“Food Smasher!! Title Screen” Sprite
Before:
After:
Decrease block count by 2
- BlueBionicWhale
-
Scratcher
61 posts
Shortening Scripts
Of course! That's all I can think of off the top of my head.
“Food Smasher!! Title Screen” SpriteBefore:
After:
Decrease block count by 2
Thank you! This has actually stopped some of the lag in my project!
- Yusei-Fudo
-
Scratcher
1000+ posts
Shortening Scripts
Of course! That's all I can think of off the top of my head.
“Food Smasher!! Title Screen” SpriteBefore:
After:
Decrease block count by 2
Thank you! This has actually stopped some of the lag in my project!

- han614698
-
Scratcher
1000+ posts
Shortening Scripts
You should almost never have two of the same hat block in one sprite.
In the backdrop, you should always have a
in each sprite.
–
I don't see any obvious mistakes in this projects.
In the backdrop, you should always have a
–
I don't see any obvious mistakes in this projects.
- BlueBionicWhale
-
Scratcher
61 posts
Shortening Scripts
You should almost never have two of the same hat block in one sprite.
In the backdrop, you should always have ain each sprite.
–
I don't see any obvious mistakes in this projects.
You should almost never have two of the same hat block in one sprite.
In the backdrop, you should always have ain each sprite.
–
I don't see any obvious mistakes in this projects.
Ok, thank you!
- Oumuamua
-
Scratcher
1000+ posts
Shortening Scripts
TBH I think you are wrong and you should try to figure more efficient scripts instead; shorten does not mean better always.
Greets.
Greets.
- Yusei-Fudo
-
Scratcher
1000+ posts
Shortening Scripts
TBH I think you are wrong and you should try to figure more efficient scripts instead; shorten does not mean better always.
Greets.
Agreed
- EpicGhoul993
-
Scratcher
1000+ posts
Shortening Scripts
Of course! That's all I can think of off the top of my head.It will malfunction if the costume number changes.
“Food Smasher!! Title Screen” SpriteBefore:
After:
Decrease block count by 2
- mmnagelia
-
Scratcher
100+ posts
Shortening Scripts
Of course! That's all I can think of off the top of my head.This is even better:
“Food Smasher!! Title Screen” SpriteBefore:
After:
Decrease block count by 2
when green flag clicked
forever
if <<(costume #) = [7]> or <(costume #) = [17]>> then
play sound [mixkit-martial-arts-fast-punch-2047 update v] until done
end
end
- Thingied
-
Scratcher
1000+ posts
Shortening Scripts
Even better one:Of course! That's all I can think of off the top of my head.This is even better:
“Food Smasher!! Title Screen” SpriteBefore:
-snip-
After:
-snip-
Decrease block count by 2when green flag clicked
forever
if <<(costume #) = [7]> or <(costume #) = [17]>> then
play sound [mixkit-martial-arts-fast-punch-2047 update v] until done
end
end
when green flag clickedShortening scripts makes things harder to work with so I would just make scripts flexible.
forever
wait until<<(costume #) = [7]> or <(costume #) = [17]>>
play sound [mixkit-martial-arts-fast-punch-2047 update v] until done
end
Last edited by Thingied (June 18, 2021 17:20:53)
- Theo_1er
-
Scratcher
500+ posts
Shortening Scripts
It's funny to see so many people trying to find the most efficient script in the “title screen” sprite while the OP asked for the “continue button” and “new game button” sprites.
- EpicGhoul993
-
Scratcher
1000+ posts
Shortening Scripts
It's funny to see so many people trying to find the most efficient script in the “title screen” sprite while the OP asked for the “continue button” and “new game button” sprites.Ikr.
- Discussion Forums
- » Help with Scripts
-
» Shortening Scripts

