Skip to content

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

@adroitwhiz

Description

@adroitwhiz

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions