Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Need help making mulitiple "Next" and "Back" buttons for a dress up game
- msboredom
-
Scratcher
10 posts
Need help making mulitiple "Next" and "Back" buttons for a dress up game
How do I make a code for multiple “Next” and “Back” buttons on a dress up game? And how do I make the costumes change when I click on those buttons?
- ElmoDuck
-
Scratcher
100+ posts
Need help making mulitiple "Next" and "Back" buttons for a dress up game
when this sprite clicked
next costume
if <Costume name = next> then
broadcast [ next]
end
if <Costume name = back> then
broadcast [ back]
end
This is what i would do :)
- Scratch-Minion
-
Scratcher
1000+ posts
Need help making mulitiple "Next" and "Back" buttons for a dress up game
Each button is a separate sprite and will have its own code.
Let us look first at the “Next” button and “Back” button for Hats.
They will each need to broadcast a message to the Hats sprite.
Now let us look at the code to actually change the costumes in the Hats sprite.
You need to make code like this for each pair of Next and Back buttons.
eg. broadcast Next Shoe, broadcast Previous Shoe
when i receive Next Shoe, when i receive Previous Shoe
Let us look first at the “Next” button and “Back” button for Hats.
They will each need to broadcast a message to the Hats sprite.
when this sprite clicked
broadcast [Next Hat v]
when this sprite clicked
broadcast [Previous Hat v]
Now let us look at the code to actually change the costumes in the Hats sprite.
when I receive [Next Hat v]
next costume
when I receive [Previous Hat v]
switch costume to ((costume [number v]) - (1))
You need to make code like this for each pair of Next and Back buttons.
eg. broadcast Next Shoe, broadcast Previous Shoe
when i receive Next Shoe, when i receive Previous Shoe
- ElmoDuck
-
Scratcher
100+ posts
Need help making mulitiple "Next" and "Back" buttons for a dress up game
I usually do it in one sprite
- Discussion Forums
- » Help with Scripts
-
» Need help making mulitiple "Next" and "Back" buttons for a dress up game