4 years ago

Scratch Guide Topic: Sprite Cloning


Sprite cloning is a very useful tool that allows you to make copies of a sprite, especially to platformer games. So, I'll give you some tips.


How can I manage each clone to have their own code?

To do this, it requires an in-sprite-only variable. I would recommend calling it "Clones". This allows each clone to check to see what kind of clone it is. You can make a custom block and set it up like this:

image.png

If you don't know what the bottom one is (That says "for each cone in clones"), it's basically a repeat loop that you can select a variable and then set the number input. When it runs, and when the coding inside that block finished, it repeats and changes the variable by 1. It's basically like the simple repeat block, but also changes the variable number by 1.

And then, you can set up the clones like this:

image.png

This is a useful method, especially to platformer games.


Concerning about messages being broadcasted and the clones take affect from it...

I bet some of you may be wondering, "Why does the clones take affect from broadcasted messages?" Well, that is how clones work. All clones are the same as the primary sprite and they copy literally everything, the variables, the costumes, the sounds, and even all of the coding. You see, according the Scratch Wiki, a clone is a carbon copy of a sprite, but it is otherwise independent. However, there is one way to fix that.

How can I prevent the clones from taking action from broadcasted messages?

To do this, you need another variable. Just name it "Clone?" with a question mark at the end. Then you need to add an IF block at the clone coding and it should look like this:

image.png

And when another message was received, the clones will not run it, and only the primary sprite can.

image.png

And there you go, problem solved.

If you have any questions, feel free to bump your comments.

I cannot guarantee that I can answer every single thing you asked. Yet, I'm not a 100% expert.



14 comments

Loading...

Next up

I would love to see how the legal battle goes...

This is a positive change to our society. Real human-made works should present as it always was.

Ufotable is making a Genshin Impact anime production, the same studio from Demon Slayer.

Holy shoot.

The Scratch Team has just recently updated their Terms of Service yesterday, letting you know they now have full permission to use your content to train AI models.

Xbox CEO is being replaced by this woman.

Buuuuuttt, I do have some skepticism because she was previously a president of CoreAI of Microsoft with absolutely no gaming background.

And yet, in her note, she said she has no tolerance to AI slop.

Ricky Rabbit's Seasonal Flavoritiez! Season 3 Episode 13 (Wet Dry roundabout)

So, apparently, TM-Attraction: TGF is broken on Microsoft Edge. I haven't changed anything in the game, either.

Though, it still works on Opera GX, so just letting people know. Use different browsers if you're playing this.

I really hope this person is aware of what Nintendo will do to anyone who makes fan projects like this.

There's a big reason why I never included any Nintendo-related references or even sounds in any of my games.

Testing out a new move! This move is for all characters

There is a special song I want to put in for phase 4 of the final boss, but it's 5 freaking MB.

Holy shoot, K&F VG 3 will probably over 100 MB total.

Be sure to clear out your RAM first before playing this game once the final release comes out.