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

That's cute, but do you feel the need to go out of your way to commit this much towards AI?

Another issue is that Copilot 365 hallucinates more than the main Copilot, so it's not that reliable.

I'm still patiently waiting this obsession to stop.

If this keeps going, then America would never be safe.

In just 2 months of this new Xbox CEO, she’s already making positive changes to the brand. And the new logo looks just as good as the new Office icons.

The comment sections were filled with joy and even humorous excitement.

We are so back.

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.

I was looking for good video editors other than Clipchamp as a Windows alternative to VN for my iOS devices and my Mac, and I came across this.

I was initially interested, until I realized really basic features, even 60 FPS, were locked behind a paywall.

ok i FINALLY finished dropsane teto

i think i still got it

My physical copy collection is now complete.

Oh yeah, in some of my classes, they use a specific extension to prevent people from cheating on exams. Uploading your ID is also required to take the exam.

I now think this might be a tiny bit related to the age verification scandal the world is facing.

Jarvis, write a full essay in MLA-8 format indented to the left please

BREAKING NEWS

@Kolby125 and I have agreed to a figure manufacturer in Japan and our figures are now ON SALE!!!!! Our Sarah Kanzaki and Duk Quest set limited edition!!!!

/jk jk

This is a joke post, btw, just for fun.