Discuss Scratch
- Discussion Forums
- » Suggestions
- » Remove the ending on the “delete this clone” block
- ramenecho
-
Scratcher
100+ posts
Remove the ending on the “delete this clone” block
The delete this clone block
delete this cloneIs really annoying, for example lets say that i have a sprite that is intended to fill a field with a bunch of clones, and it often can trigger even when there are still clones on the field, normally you would have to do something like this:
when I receive [refill v]It doesn’t seem like much, but having the delete this clone block have a bottom connector would allow for it only needing one block
if <[1] = [1]> then
delete this clone
end
All the rest of the code
when I receive [Refill v]I put a plus so that the forum blocks change it to what im trying to show, but it’s much simpler and much cleaner.
delete this clone+
All the rest of the code
- BigNate469
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
Just going to point out a few workarounds here:
when I receive [something v]or
if <not <>> then // Works because an empty not block returns true
delete this clone
end
...
when I receive [something v]or
...
when I receive [something v]
delete this clone
define delete cloneThat said, adding this block would reduce redundant code and make programs more efficient, but it could also make it more confusing for some people new to clones, because they could be trying to do something like
delete this clone
when I receive [something v]
delete clone
...
when I start as a cloneand get confused as to why their clone isn't moving 10 steps, but is being deleted instead.
...
delete this clone :: stack
move (10) steps
- cookieclickerer33
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
Support, you shouldn’t have to do this
repeat (1)
delete this clone
end
- Za-Chary
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
it could also make it more confusing for some people new to clones, because they could be trying to do something likeThis is my understanding on the design choice as well. In basic settings, “delete this clone” is used to delete a clone entirely; it may be confusing to newer programmers as to why a clone could potentially run more scripts after being deleted. (We all know that it doesn't, but a new programmer doesn't know that.) For those not new to programming, their favorite workaround is simple enough.when I start as a cloneand get confused as to why their clone isn't moving 10 steps, but is being deleted instead.
...
delete this clone :: stack
move (10) steps
- cookieclickerer33
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
Cap blocks as a convention don’t really make sense because of how few there are. And that the stop block doesn’t even have to be a capit could also make it more confusing for some people new to clones, because they could be trying to do something likeThis is my understanding on the design choice as well. In basic settings, “delete this clone” is used to delete a clone entirely; it may be confusing to newer programmers as to why a clone could potentially run more scripts after being deleted. (We all know that it doesn't, but a new programmer doesn't know that.) For those not new to programming, their favorite workaround is simple enough.when I start as a cloneand get confused as to why their clone isn't moving 10 steps, but is being deleted instead.
...
delete this clone :: stack
move (10) steps
I say remove them completely, I see them cause more issues then they solve
- iiucandyfloss
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
if a clone is deleted what code would you need it to run?
- SpyCoderX
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
(#7)The main sprite.
if a clone is deleted what code would you need it to run?
For example, if you wanted to clear all the clones and reset the main sprite to some position, you have to do this:
when I receive [reset v]
delete this clone
when I receive [reset v]
go to x: (0) y: (0)
The suggestion wants to be able to combine these:
when I receive [reset v]
delete this clone ::stack
go to x: (0) y: (0)
- rdococ
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
Beginners could be confused, and the workaround is pretty simple.
Last edited by rdococ (Dec. 17, 2024 18:49:54)
- medians
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
I mean, in that case, you could reverse the delete this clone and go to x: () y: () blocks(#7)The main sprite.
if a clone is deleted what code would you need it to run?
For example, if you wanted to clear all the clones and reset the main sprite to some position, you have to do this:when I receive [reset v]
delete this clone
when I receive [reset v]
go to x: (0) y: (0)
The suggestion wants to be able to combine these:when I receive [reset v]
delete this clone ::stack
go to x: (0) y: (0)
- ramenecho
-
Scratcher
100+ posts
Remove the ending on the “delete this clone” block
I dont know why you guys are trying to think of examples to use this in, i gave an example in the main message.I mean, in that case, you could reverse the delete this clone and go to x: () y: () blocks(#7)The main sprite.
if a clone is deleted what code would you need it to run?
For example, if you wanted to clear all the clones and reset the main sprite to some position, you have to do this:when I receive [reset v]
delete this clone
when I receive [reset v]
go to x: (0) y: (0)
The suggestion wants to be able to combine these:when I receive [reset v]
delete this clone ::stack
go to x: (0) y: (0)
for example lets say that i have a sprite that is intended to fill a field with a bunch of clones, and it often can trigger even when there are still clones on the field
- Dragon_hord
-
Scratcher
95 posts
Remove the ending on the “delete this clone” block
The block you are suggesting would break many projects because a clone can't do anything if it doesn't exist
- medians
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
The block you are suggesting would break many projects because a clone can't do anything if it doesn't existCan you explain how exactly this would break projects? None of the code afterwards would run, and the block would act exactly the same but as a stack block. The actual functionality wouldn't change. This is more for things like broadcasts so you can run code afterwards, not just for clones.
- bungamer07
-
Scratcher
100+ posts
Remove the ending on the “delete this clone” block
one* block workaround
define delete this clone
delete this clone
- medians
-
Scratcher
1000+ posts
Remove the ending on the “delete this clone” block
one* block workaroundYou would have to create a custom block though, if that workaround was used.define delete this clone
delete this clone
Last edited by medians (Dec. 18, 2024 18:28:34)
- Discussion Forums
- » Suggestions
-
» Remove the ending on the “delete this clone” block