How can I get the name of a sprite stored in a list?

Hello! I'm working on a block-based programming language (within Snap!'s stage) inspired by Lisp. I am currently implementing block snapping, and I am using Snisp script pic (2) to get the blocks that the selected block is touching.

Since all blocks are clones of one Block sprite, I would like to check if the objects in the returned list have the name "Block," but I can't seem to do it. I've tried to use Snisp script pic (4), but that threw an error. If there is no way to get the name of a sprite stored as an object, is there an alternate system that I can use?

Thank you!

You were on the right track, though I'm not entirely sure why it didn't work.

However there is another way that might be more clear what it's doing


or

Thank you, but I tried that already. I found the problem. The clones' names are empty strings.

You could check if the clone's parent is the Block sprite.

This works! Thank you!

Do you know why the names were empty, though?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.