Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Too many clones being created
- BigBadCheeseMan
-
8 posts
Too many clones being created
Okay, it's probably a very simple fix, but in my project here, I have a set of scripts where one sprite will broadcast a message to create a clone, and then another sprite will be cloned. This works fine for about five seconds, then it starts to create clones way too quickly. am I overlooking something? help would be great!
EDIT: I just thought of switching the broadcast block for a cloning block, but it still make too many clones. While I'm at it, can anyone help me with giving the different clones different amounts of “health?” as well as creating a smooth, semi-random movement piece? that would be great!
EDIT: I just thought of switching the broadcast block for a cloning block, but it still make too many clones. While I'm at it, can anyone help me with giving the different clones different amounts of “health?” as well as creating a smooth, semi-random movement piece? that would be great!
- crisostimo
-
500+ posts
Too many clones being created
I have a well commented tutorial on cloning that may help you:
https://scratch.mit.edu/projects/94046493/
https://scratch.mit.edu/projects/94046493/
- Brontosplachna
-
100+ posts
Too many clones being created
The project is not shared, but I will remind you that clones receive and act on messages just like the original sprite does. So a script like
will create one new clone for each clone that receives the message.
will create one new clone for each clone that receives the message.
- asivi
-
1000+ posts
Too many clones being created
That is the reason why the parent and its clone are needing a variable for that sprite only and to give different values for both. The project is not shared, but I will remind you that clones receive and act on messages just like the original sprite does. So a script like
will create one new clone for each clone that receives the message.
Last edited by asivi (June 3, 2016 18:23:37)
- BigBadCheeseMan
-
8 posts
Too many clones being created
Sorry about not sharing it, but I think I get it now. Thanks for clearing it up!
- asivi
-
1000+ posts
Too many clones being created
Your'e welcome. Have fun! Sorry about not sharing it, but I think I get it now. Thanks for clearing it up!
- Marreepsie
-
1 post
Too many clones being created
Replace the broadcast “***” with create clone of *the sprite who receives the messages. Worked for me.
- cs4117933
-
7 posts
Too many clones being created
I made a clone counter and i guess you could use that to set a cap to the clones by putting the dots variable to whatever the amount of clones you need https://scratch.mit.edu/projects/509963143/
- brax-boy
-
4 posts
Too many clones being created
That is the reason why the parent and its clone are needing a variable for that sprite only and to give different values for both. The project is not shared, but I will remind you that clones receive and act on messages just like the original sprite does. So a script like
will create one new clone for each clone that receives the message.
Well how does that work without a message being broadcasted?
Cause I’m trying to make fruit ninja but it’s shot-gunning fruit and bombs, please help.
- cs2722201
-
100+ posts
Too many clones being created
here, I have a set of scripts where one sprite will broadcast a message to create a clone, and then another sprite will be cloned. This works fine for about five seconds, then it starts to create clones way too quickly. am I overlooking something? help would be great!to give each clone a different health make a new variable for this sprite only name it health set the health to whatever you before you clone then when you clone the clone will have a different health Okay, it's probably a very simple fix, but in my project
EDIT: I just thought of switching the broadcast block for a cloning block, but it still make too many clones. While I'm at it, can anyone help me with giving the different clones different amounts of “health?” as well as creating a smooth, semi-random movement piece? that would be great!
https://scratch.mit.edu/projects/746208975/
check this link out and see what I did with the clone ids for an example
or check this project
https://scratch.mit.edu/projects/739395921/
go into enemies sprites go into custom block that spawns clones then see how I set the health to 1 before they get clones for a better example
Last edited by cs2722201 (Oct. 17, 2022 00:48:14)
- Discussion Forums
- » Help with Scripts
-
» Too many clones being created