Discuss Scratch

han614698
Scratcher
1000+ posts

Max Costume

Is there any possible way I could detect how many costumes are in the sprite?
TheAnomalousPseudo
Scratcher
1000+ posts

Max Costume

set [foo v] to [2]
switch costume to [costume2 v]
repeat until <(costume#) = [1]>
next costume
change [foo v] by [1]
end

However this won't work for 1 costume.

Last edited by TheAnomalousPseudo (May 6, 2021 12:58:11)

han614698
Scratcher
1000+ posts

Max Costume

TheAnomalousPseudo wrote:

set [foo v] to [2]
switch costume to [costume2 v]
repeat until <(costume#) = [1]>
next costume
change [foo v] by [1]
end

However this won't work for 1 costume.
What variable stores the end result?
Theo_1er
Scratcher
500+ posts

Max Costume

(foo)
PersonalPi
Scratcher
22 posts

Max Costume

switch costume to [whichever costume is last]
set [costume amount] to (costume #)
TheAnomalousPseudo
Scratcher
1000+ posts

Max Costume

Wait no…At the top, change set foo to 2 to set foo to 1, otherwise you'll get 1+ final costume#
Oumuamua
Scratcher
1000+ posts

Max Costume

Yusei-Fudo
Scratcher
1000+ posts

Max Costume

TheAnomalousPseudo wrote:

set [foo v] to [2]
switch costume to [costume2 v]
repeat until <(costume#) = [1]>
next costume
change [foo v] by [1]
end

However this won't work for 1 costume.

You can do this that, just needed a bit more script
:
Oumuamua
Scratcher
1000+ posts

Max Costume

Those scripts below do the job


Powered by DjangoBB