How to check if a sprite is touching a specific color in Scratch? Preview

If we wish to check if two sprites touch eachother or a specific sprite is touching something on the screen, the easiest thing to do would be to check the color! Now you will findout how to do this.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1597
  • 30 Mar 2020

We can check if the sprite is touching a specific color using the "touching color?" block. It is located in the grey block palette:

content picture

This block is a logic block, which means two things:

  1. It cannot be used on its own in the program, it must be used with other blocks such as the "if" block;
  2. It only gives us two results - True or Falce. True if it touches the color and false if it doesn't!

To set the correct color, we have two options. The first and easiest way is to select it from the game's screen. Thiss allows us to pick the correct color from the place we want without having to mess with the color parameter settings. The setting itself looks like this:

content picture

If we cannot use the first option for some reason, we can always set the color manually. For this purpose, we have three sliders, that  set the following three aspects of the color:

  1.  Hue - This slider gives us the base color that we will edit with the other two sliders.
  2. Saturation - this slider determins how saturated the color will be
  3. Value - This slider determins the value of the color or how bright it is going to be.

 

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Keep 'em clean - remote Scratch game course
  • 41
  • 0:00
  • 70
Image for Lesson 8 - How to mess up the clean
  • 4
  • 3
  • 5
  • 3d_rotation 0