Discuss Scratch

-Quantum_Studios-
Scratcher
500+ posts

Why can't "touching color" detect pen?

I'm trying to make a pen game. The collision is currently based on using the
 <touching color [#000000] ?> 
block to detect when the player touches black. It works fine when the level is a backdrop, but when I try to draw it with pen, the collision fails. Why does this happen?
------------------gr
New Scratcher
9 posts

Why can't "touching color" detect pen?

Possibly because the pen is just for visual effects and not actually a backdrop or sprite.
ajskateboarder
Scratcher
1000+ posts

Why can't "touching color" detect pen?

Yeah this is confusing
Does this also apply to stamps?
blablablahello
Scratcher
1000+ posts

Why can't "touching color" detect pen?

Id actually assume this is due to how color is different on the stage then on the sprite editor, so it might actually be caused by them not being the same black

idk if this is true tho
7salad3salad
Scratcher
1000+ posts

Why can't "touching color" detect pen?

ajskateboarder wrote:

Yeah this is confusing
Does this also apply to stamps?
I think stamps are pen
John25654
Scratcher
35 posts

Why can't "touching color" detect pen?

Because It Is A Part Of The Scratch Extensions And Scratch Team Will Fix It
medians
Scratcher
1000+ posts

Why can't "touching color" detect pen?

John25654 wrote:

Because It Is A Part Of The Scratch Extensions And Scratch Team Will Fix It
Uhm, how is it part of the Scratch extensions?
Also Typing Like This Makes The Text Hard To Read
Edit: oh wait I forgot they made it an extension in 3.0 LOL

Last edited by medians (April 11, 2023 23:30:40)

King_of_Zyjaria
Scratcher
65 posts

Why can't "touching color" detect pen?

For me, touching color does work. Random guess that you are making it clear every frame? if so, what's happening is that it's clearing, checking, then relaying the pen marks.
DifferentDance8
Scratcher
1000+ posts

Why can't "touching color" detect pen?

John25654 wrote:

Because It Is A Part Of The Scratch Extensions And Scratch Team Will Fix It
BIIAPOTSEASTWFI lmao

seriously, though. Typing With All Words Starting With Capital Letters makes it sound like an acronym even when it isn't meant to be.
guestlol12
Scratcher
19 posts

Why can't "touching color" detect pen?

it does not detect bc it is a pen not a detector
qwerty_wasd_gone
Scratcher
1000+ posts

Why can't "touching color" detect pen?

strange, it works for me, i think it's because you are using a different shade of black for the detector
-ShadowOfTheFuture-
Scratcher
1000+ posts

Why can't "touching color" detect pen?



I tested it, and it definitely works for me.

The touching color block can be a bit finicky, and it's possible the color you're drawing with the pen isn't exactly the same as the color you're checking for, even if they look very similar.

One thing you could potentially try doing, if it's feasible, is to specify exact RGB values for all your colors using numbers, instead of trying to use the color options in the dropdown. You can drag reporter blocks into the color picker, which allows you to specify numerical values for colors. The RGB value of a color is
(amount of red) * 65536 + (amount of green) * 256 + (amount of blue)
(((red) * (65536)) + (((green) * (256)) + (blue)))

If you do this for every “set pen color” block and every “touching color” check, the color detection might be less likely to fail, since you'd be specifying and checking exact values for your colors instead of eyeballing them.

Last edited by -ShadowOfTheFuture- (April 12, 2023 19:01:01)

zscalesz
Scratcher
1 post

Why can't "touching color" detect pen?

It works just fine for me, so I think the color must be slightly off
-Quantum_Studios-
Scratcher
500+ posts

Why can't "touching color" detect pen?

King_of_Zyjaria wrote:

For me, touching color does work. Random guess that you are making it clear every frame? if so, what's happening is that it's clearing, checking, then relaying the pen marks.
Yes, it does erase all every frame. I have to for the player to be rendered with pen.
donotforgetmycode
Scratcher
1000+ posts

Why can't "touching color" detect pen?

Can you give a link to the project? The touching block works for me.
red-fox-codes
Scratcher
43 posts

Why can't "touching color" detect pen?

-Quantum_Studios- wrote:

I'm trying to make a pen game. The collision is currently based on using the
 <touching color [#000000] ?> 
block to detect when the player touches black. It works fine when the level is a backdrop, but when I try to draw it with pen, the collision fails. Why does this happen?

It works for me (see my project), perhaps the color you are trying to detect is slightly off?
If you want, I could take a look.

Hope this helps! - Red Fox Codes
guestlol12
Scratcher
19 posts

Why can't "touching color" detect pen?

huh? i did not know that
i suck 
and also someone made fake blocks

Last edited by guestlol12 (April 16, 2023 13:36:42)

Powered by DjangoBB