Discuss Scratch

Henro2121
Scratcher
4 posts

how to make something change to a different costume when clicked?

so I am making a game and something inside it has this button that when you click it it should change to a different costume and then when it gets to the max it should go back to the start
this is what my code looks like:
when this sprite clicked
if <(costume #) = [easy]> then
switch costume to [ normal]
end

plz respond if you have a solution because I want to become really smart with scratch THANKS!!!!!!!!!!!!!!!!
tiaza
Scratcher
500+ posts

how to make something change to a different costume when clicked?

Henro2121 wrote:

so I am making a game and something inside it has this button that when you click it it should change to a different costume and then when it gets to the max it should go back to the start
this is what my code looks like:
when this sprite clicked
if <(costume #) = [easy]> then
next costume

switch costume to [ normal]
end

plz respond if you have a solution because I want to become really smart with scratch THANKS!!!!!!!!!!!!!!!!
Hi I got a solution!
- At first the script looks a bit….too complex you can make it easier.
So here we go;
when this sprite clicked
next costume
Or
when this sprite clicked
switch costume to [ v]
So that's it. I recommend the first script. It means that if you click on it, it changes to the next costume and so if it has reached the last costume it changes to the first one then the second one and etc. If you want that it changes costumes in a different order you can put them in order
In the editor of the sprite or just make a script that looks like the second Option I wrote earlier.
I hope I could help you
-tiaza

Last edited by tiaza (Sept. 7, 2022 08:57:44)

Loca_the_Cool
Scratcher
100+ posts

how to make something change to a different costume when clicked?

when this sprite clicked
switch costume to ((costume #) mod [number of wanted costumes])
Or
when this sprite clicked
next costume
Lionboi18
Scratcher
5 posts

how to make something change to a different costume when clicked?

Maybe I should try these blocks
when this sprite clicked
next costume
switch backdrop to v]

switch costume to [ v]
Lionboi18
Scratcher
5 posts

how to make something change to a different costume when clicked?

Oh my bad I mean these blocks
when this sprite clicked
next costume
switch costume to [ v]

Powered by DjangoBB