Discuss Scratch

Featherfall9
Scratcher
10 posts

How do I generate multiple characters from 1 sprite?

I want to make a game like Clangen (or something similar to the Cats of All Clans game) but I'm not sure how to regulate the number of sprites. I know that there's a way to create multiple characters using 1 sprite, but I don't know the code for it. Please help!

(Like instead of 1 sprite for every character, using 1 sprite to code for all the characters)
ItsAlwaysSoupTime
Scratcher
3 posts

How do I generate multiple characters from 1 sprite?

Hi Featherfall9!
Sorry about my response, I don't post on forums that often lol.
So, I'm not too good at this, so if I'm not clear, please ask somebody else, but what you can do is this.
I'm still learning on how to post blocks, so I'm just going to explain to the best of my knowledge.
If all of the characters are designed, make the first letter of each character costume a different letter from the other characters.
Then, you're going to create a clone on the main script under
when green flag clicked
Then, create a different script starting with
when I start as a clone
Under the clone block, put and if statement saying "If letter 1 of costume name = ".
In the if statement, put whatever you want your character to do. Say it attacked or something (I'm sorry I never played the game you're mentioning) then you would put the code for the character to attack. If you want a different character to do a different thing than the first, put the same clone code but update the costume name.

One thing about this, is that you're going to have to make multiple cones from other clones.
I'm very sorry if my response wasn't clear. If you need any more help, you can contact somebody.
Happy coding
CHEEZ_ITZ_12oz
Scratcher
100+ posts

How do I generate multiple characters from 1 sprite?

I would make clones of the sprite. You can control each one individually by giving each sprite an id. Make a local variable (id) and change id by 1 and clone. Repeat for however many sprites you want.
set [id v] to [0]
repeat (10)
create clone of [sprite v]
change [id v] by (1)
end
Each clone will have their own individual id so you can call them individually using an if block
if <(id) = [3]> then
Do stuff
end
Hope this helps.
Featherfall9
Scratcher
10 posts

How do I generate multiple characters from 1 sprite?

Thank you so much!

Powered by DjangoBB