2 bugs associated with list, costume and color

Below is a block that returns the modified version of costume 1 of the sprite:


However, if you type in the list manually...

Sooooo there's a difference between a snap-block-generated list and the list typed manually... This bug exists for all types of costume reporters like "skew () to () degrees" or "() of costume ()". It's fine with the "switch to costume ()" though.

Also a problem with the "touching (color)?" block, the editor runs this block so slow that if you only have 2 clones running a forever loop with a "touching (color)?" block, you will already be lagging (running the following scripts).


The difference isn't actually a lust generated by snap and a list manually typed, it's actually the contents of the list.

It's not obvious, in fact snap tries to hide it, but what gets reported from the (numbers from (1) to (2) block are numbers, whereas when you manually type in the (list [] @<>) block are strings (text).

What the costume blocks do is, if the value is a number, it gets the costume at that index, but if it's a string, it tries to get a costume by name. This can be demonstrated easily.


And if uou have a costume named 1, you'll get that costume instead.

I'm not saying this isn't a bug, in fact I do agree that this should be changed, I'm just explaining that it's not the lists.

It is well known that the <touching color [#000] ?> block is slow, but what intrigues me is that you specified "in the editor". Does it not lag in presentation mode (full screen) and on the project page?

ohhh there we go. So it's a string type if you type in manually... But I was convinced it's the number type using "is identical" (block coding is annoying when a variable could be any type). And no, it lags on both sides. Okay sounds like I need to figure a way of not using that block. Thanks for the reply :smiley:

FWIW, I dare say at least something is a bug:

untitled script pic(1)

untitled script pic(2)

untitled script pic

Works for me without any lag.
Maybe visible stepping :footprints: is enabled.

I've noticed that many things lag on my phone but not on my computer, so it's probably just that your computer is more powerful.

Same. Although I did have one weird lag spike when I was trying to edit the code for the clones.

I have, in fact, had a similar issue where Snap! fails to recognize the equivalency between numbers and strings:


I spent ages debugging before I finally figured it out. All because I was too lazy to switch to the operators palette and grab a Boolean block.

I'm pretty sure the touching color block is horribly inefficient no matter what, it's just the lag can be counteracted with a better computer. For example, I sometimes make games that run at an incredibly stable 60 fps for me, but when I have a friend try them on a different computer, it lags so badly that it's entirely unplayable.

anything but 0 (the number, not the string) is considered true

like this:

my opinion on this: The If block is design to be use with boolean not number or letter...

I knew that part already, but

was what was confused me.

PS: I'm going to nitpick what you said: Anything but 0 (the number, not the string) OR FALSE is considered true ;).