Scratch-render: Touching color should work when sprites are not visible

Created on 8 Dec 2017  ·  3Comments  ·  Source: LLK/scratch-render

From @towerofnix


Expected (2.0) Behavior
"Touching color" returns true when the sprite overlaps the given color, regardless of whether or not the sprite is hidden. "Touching sprite" returns true if the sprite overlaps the other sprite, and the sprite is shown; if it is hidden, "touching sprite" returns false.

Actual Behavior
"Touching color" returns false when the sprite is hidden. "Touching sprite" behaves as described in 2.0.

Steps to Reproduce
Demo project: 2.0, 3.0. Move the sprite around using the mouse, and use the space bar to toggle the sprite between being shown and hidden. Observe the contents of the speech bubble while dragging.

(Note - in the speech bubble that shows up, you can see that, next to "touching (sprite)", sometimes "undefined" is being said instead of "false".. undefined is a falsey value, so this is okay, but maybe something to look into if it's not already reported somewhere..)

I don't know what the expected behavior is, but I would think that this incompatibility could be a source of issues in platformer projects?

Demo project 2: 2.0, 3.0. Notice how, in Scratch 3.0, when you hide the sprite, it falls through the floor! 🕳

Operating System and Browser
Firefox Nightly (59) on Debian Testing. I'm fairly certain this same bug was reported here.

bug prio-critical

Most helpful comment

Eek here are 4 cases I tested.

| | Hidden | Ghost 100 |
|-----------------|--------------|-----------|
| Touching sprite | not detected | detected |
| Touching color | detected | detected |

In scratch 2
image

In scratch 3
image

All 3 comments

Eek here are 4 cases I tested.

| | Hidden | Ghost 100 |
|-----------------|--------------|-----------|
| Touching sprite | not detected | detected |
| Touching color | detected | detected |

In scratch 2
image

In scratch 3
image

Broken demo project links in the original post btw: demo 1 in 2.0, 3.0, demo 2 in 2.0, 3.0.

[removed, meant to comment on the PR]

Was this page helpful?
0 / 5 - 0 ratings