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.
- 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:
This block is a logic block, which means two things:
- It cannot be used on its own in the program, it must be used with other blocks such as the "if" block;
- 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:
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:
- Hue - This slider gives us the base color that we will edit with the other two sliders.
- Saturation - this slider determins how saturated the color will be
- 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