Discuss Scratch

_tornad0scr_tch
Scratcher
2 posts

How do clones work?

You know, I've learned a tiny bit about clones from tutorials, and kind of know how to put clones in different places, but clones can get super laggy. In this topic, I just want tips about clones.

Thanks for reading!
Jman1111
Scratcher
54 posts

How do clones work?

There is a lot to talk about regarding clones, however I can give you a few more advanced tips on how to use them effectively and reduce lag.

  • Check run with screen refresh in custom blocks for code that can executed instantly. This can cause crashing with loops / wait so be mindful when checking this.
  • Clones all receive broadcasts so better to have a check in place if you only need the original copy / one specific copy to be a receiver.
  • Don't keep unnecessary code running in loops, e.g only update look blocks such as “change color” or set size when absolutely necessary.
  • Limit the complexity of the clones and general number of clones. Delete clones that you do not need anymore.
  • Since clones have their own copy of (for this sprite only) variables, you can use that to your advantage to give clones an “index” and then store specific data for clones into lists that can be used by other sprites.

Last edited by Jman1111 (Feb. 24, 2023 20:25:03)


Want to learn how improve your scratch projects or collaborate?
Follow and reach out to me on my profile page!
- Jman1111

Highlighted Project: 2048 Remastered

Powered by DjangoBB