Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Any way to make multiple clones be deleted at once?
- Mikeygaming0041
-
Scratcher
37 posts
Any way to make multiple clones be deleted at once?
So im making a Plants vs. Zombies game in scratch
(or rather UPDATING it)
and I want to add a level selection screen, but I need all my plants to be deleted when you win at a level.
I would be glad if anyone from the community or staff can help!
(or rather UPDATING it)
and I want to add a level selection screen, but I need all my plants to be deleted when you win at a level.
I would be glad if anyone from the community or staff can help!
- yadayadayadagoodbye
-
Scratcher
1000+ posts
Any way to make multiple clones be deleted at once?
yes, just use a broadcast. Each clone receives the broadcast seperately and thus you could just have something like
which will delete all sprites that are clones when the broadcast is fired (note that you'd have to put that under every sprite that could potentially make a clone that you want to delete)
when I receive [delete all clones v]
delete this clone
which will delete all sprites that are clones when the broadcast is fired (note that you'd have to put that under every sprite that could potentially make a clone that you want to delete)
- Mikeygaming0041
-
Scratcher
37 posts
Any way to make multiple clones be deleted at once?
Hmmm, lemme test that!
- -Valtren-
-
Scratcher
1000+ posts
Any way to make multiple clones be deleted at once?
(#2)To add on to that, if you only want specific clones to be deleted, you can do something like this:
yes, just use a broadcast. Each clone receives the broadcast seperately and thus you could just have something likewhen I receive [delete all clones v]
delete this clone
which will delete all sprites that are clones when the broadcast is fired (note that you'd have to put that under every sprite that could potentially make a clone that you want to delete)
when I receive [delete all clones v]
if <<(CloneID) = (... :: grey)> or <(CloneID) = (... :: grey)>> then
delete this clone
end
- horizontal_shading
-
Scratcher
1000+ posts
Any way to make multiple clones be deleted at once?
I reported to move it to HwS, it doesn't fit in QaS in my opinion.
- Discussion Forums
- » Help with Scripts
-
» Any way to make multiple clones be deleted at once?