Discuss Scratch
- Discussion Forums
- » Bugs and Glitches
- » list bug
- Dano92e
-
Scratcher
4 posts
list bug
My browser / operating system: Windows NT 10.0, Chrome 145.0.0.0, No Flash version detected
If you add an item to the list when you receive a message, some strange bug will appear, and the items will start being added incorrectly. Also, when using the delete function in the clone code, all items from the list will be deleted. There is no way to get around this bug, strange things happen with any attempts.
If you add an item to the list when you receive a message, some strange bug will appear, and the items will start being added incorrectly. Also, when using the delete function in the clone code, all items from the list will be deleted. There is no way to get around this bug, strange things happen with any attempts.
- Dano92e
-
Scratcher
4 posts
list bug
Can you share a project where this is happening?Here is the link to the project: https://scratch.mit.edu/projects/1290888644/
- TimothyLawyer
-
Scratcher
1000+ posts
list bug
Each clone also has a “when I receive” broadcast script same as the original sprite. So, you start with 1 original sprite and each time a broadcast is sent it is received by the original sprite and any clones of it
. In your project, this doubles the number of sprites each time a broadcast is sent.
start of project, green flag
list is empty and no clones, total number of sprites: 1 (1 original and 0 clones)
1st broadcast
adds 1 item to list and creates clone, total number of sprites: 2 (1 original and 1 clone)
2nd broadcast
adds 2 more items to list and creates 2 more clones, total number of sprites: 4 (1 original and 3 clones)
3rd broadcast
adds 4 more items to list and creates 4 more clones, total number of sprites: 8 (1 original and 7 clones)
4th broadcast
adds 8 more items to list and creates 8 more clones, total number of sprites: 16 (1 original and 15 clones)
The number of items in the list matches the number of clones at each step. (Each time a broadcast is received an item is added to the list and then a clone is made.)
To not have clones change the same list as the original sprite, make the list for this sprite only. Then the original sprite and each clone gets its own list.
start of project, green flag
list is empty and no clones, total number of sprites: 1 (1 original and 0 clones)
1st broadcast
adds 1 item to list and creates clone, total number of sprites: 2 (1 original and 1 clone)
2nd broadcast
adds 2 more items to list and creates 2 more clones, total number of sprites: 4 (1 original and 3 clones)
3rd broadcast
adds 4 more items to list and creates 4 more clones, total number of sprites: 8 (1 original and 7 clones)
4th broadcast
adds 8 more items to list and creates 8 more clones, total number of sprites: 16 (1 original and 15 clones)
The number of items in the list matches the number of clones at each step. (Each time a broadcast is received an item is added to the list and then a clone is made.)
To not have clones change the same list as the original sprite, make the list for this sprite only. Then the original sprite and each clone gets its own list.
- Discussion Forums
- » Bugs and Glitches
- » list bug
