Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Character Creator
- DqrwinWatterson
-
Scratcher
100+ posts
Character Creator
I am making a comic maker and I want to add customizable characters can anyone help me out please?
- yetrop
-
Scratcher
500+ posts
Character Creator
There are a few ways you can do this. One fairly easy way is to make different sprites for clothes, hair, eyes, and so on, and then make it so that when people click each of these items, it changes costume. Then, for each customizeable object, they can keep clicking until they find something they like. I think the code would be as simple as this:
If you want to add buttons, you could do a similar thing, but instead of changing costumes, you could make it so that when the sprite is clicked it broadcasts a message to the sprite you want to change. Just make sure each button is a separate sprite!
Using hair as an example, in the hair button sprite, it would look like this:
You said you wanted to make a comic out of this. Does this mean you want the character to be moveable? If so, that would complicate things, but it still wouldn't be impossible. One option would be just to have a separate costume for each option– let's say blonde hair brown eyes, blonde hair blue eyes, brown hair brown eyes, brown hair blue eyes, and so on… (If you're going this route, you probably don't want that many different options– this can get very tedious very quickly!)
Another (less straightforward) option is to make sure all of the sprites are centered in the drawing editor, then move them (not using the drawing editor) until they look centered and the figure looks normal. See what y values they have. Then, wherever you want the character to move to in the future, just add or subtract the distance they were earlier to the y value. For example, if the y value on my hair was “10” after I tried to center it and I wanted the figure to move to (-100, 30), I'd make the hair go to (-100, 40), since I'm adding 10 to the y value.
Hope this helped!
when this sprite clicked
next costume
If you want to add buttons, you could do a similar thing, but instead of changing costumes, you could make it so that when the sprite is clicked it broadcasts a message to the sprite you want to change. Just make sure each button is a separate sprite!
Using hair as an example, in the hair button sprite, it would look like this:
when this sprite clickedThen in the actual hair sprite it would look like this:
broadcast [hair v]
when I receive [hair v]
next costume
You said you wanted to make a comic out of this. Does this mean you want the character to be moveable? If so, that would complicate things, but it still wouldn't be impossible. One option would be just to have a separate costume for each option– let's say blonde hair brown eyes, blonde hair blue eyes, brown hair brown eyes, brown hair blue eyes, and so on… (If you're going this route, you probably don't want that many different options– this can get very tedious very quickly!)
Another (less straightforward) option is to make sure all of the sprites are centered in the drawing editor, then move them (not using the drawing editor) until they look centered and the figure looks normal. See what y values they have. Then, wherever you want the character to move to in the future, just add or subtract the distance they were earlier to the y value. For example, if the y value on my hair was “10” after I tried to center it and I wanted the figure to move to (-100, 30), I'd make the hair go to (-100, 40), since I'm adding 10 to the y value.
Hope this helped!
- Discussion Forums
- » Help with Scripts
-
» Character Creator