Discuss Scratch

mythiccoder321
Scratcher
20 posts

Trouble with deleting clones

PROBLEMS-

1-i set up a script to delete the sprite when the variable age of death reaches a certain number.
however the sprites just freeze when they die.

2-i want the clones to have different time of death and age of death each.
i also want them to show their age and age of death whenever i click that particular clone.

pls help guys.

https://scratch.mit.edu/projects/992722302

Last edited by mythiccoder321 (April 1, 2024 09:52:24)

deck26
Scratcher
1000+ posts

Trouble with deleting clones

You need local variables - for this sprite only. When variables are defined that way each clone has its own copy of the variable. Not sure if that fixes both issues but it's the key point for the second one.
invalidaccess
Scratcher
72 posts

Trouble with deleting clones

mythiccoder321 wrote:

PROBLEMS-

1-i set up a script to delete the sprite when the variable age of death reaches a certain number.
however the sprites just freeze when they die.

2-i want the clones to have different time of death and age of death each.
i also want them to show their age and age of death whenever i click that particular clone.

pls help guys.

https://scratch.mit.edu/projects/992722302
something like this?
https://scratch.mit.edu/projects/992071436/
mythiccoder321
Scratcher
20 posts

Trouble with deleting clones

deck26 wrote:

You need local variables - for this sprite only. When variables are defined that way each clone has its own copy of the variable. Not sure if that fixes both issues but it's the key point for the second one.


i did do that.But the variable doesn't change and the clone still freezes when it dies.
deck26
Scratcher
1000+ posts

Trouble with deleting clones

You have nested forever loops so if the clone isn't deleted first time through the main loop it is probably stuck in the second forever loop.
invalidaccess
Scratcher
72 posts

Trouble with deleting clones

invalidaccess wrote:

mythiccoder321 wrote:

PROBLEMS-

1-i set up a script to delete the sprite when the variable age of death reaches a certain number.
however the sprites just freeze when they die.

2-i want the clones to have different time of death and age of death each.
i also want them to show their age and age of death whenever i click that particular clone.

pls help guys.

https://scratch.mit.edu/projects/992722302
something like this?
https://scratch.mit.edu/projects/992071436/
did that help you or not?

Powered by DjangoBB