Skip to content

"color () is touching ()" block does not work properly on ghosted sprites #575

@adroitwhiz

Description

@adroitwhiz
Contributor

Expected Behavior

When the "color () is touching ()" block is used, the ghost effect of the sprite calling it should not affect the result.

Actual Behavior

If the sprite calling "color () is touching ()" has a ghost effect applied, the first argument to "color () is touching()" (the color mask to be applied to the sprite) will be incorrectly darkened, meaning that it will not match properly.

This is a regression introduced by #515.

This has the potential to break the commonly-used "wall sensor" pattern-- I can't find any links right now, but I often come across projects that apply the ghost effect to a "wall sensor".

Steps to Reproduce

  1. Add a new sprite
  2. Drag the new sprite over an orange region of the default cat
  3. Select the default cat
  4. Drag a "color () is touching ()" block onto the default cat's block workspace
  5. Set the first argument to the default cat's orange color via the eyedropper
  6. Set the second argument to one of the overlapping sprite's colors
  7. Observe that if you click the block, it returns true
  8. Set the default cat's ghost effect to a nonzero value
  9. Observe that the block no longer returns true when executed

Or see this repro project.

Operating System and Browser

All

Activity

BryceLTaylor

BryceLTaylor commented on Mar 24, 2020

@BryceLTaylor

Here's a project I made in scratch 2. It has a different behavior in scratch 2 vs. 3.

In scratch 2 a ghosted cat with the "color touching color" block still reports true if the sprite is touching the other color.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Participants

      @BryceLTaylor@adroitwhiz

      Issue actions

        "color () is touching ()" block does not work properly on ghosted sprites · Issue #575 · scratchfoundation/scratch-render