Discuss Scratch

sithsiri
Scratcher
100+ posts

Color Sensing

Here is my idea:
(color [Sprite1 v] touching ::sensing)

For example:
when green flag clicked
forever

if <(color [Color Sprite 1 v] touching ::sensing) = (color [Color Sprite 2 v] touching ::sensing)> then
say [Color match!] for (2) secs
end

end

Edit: 3 options for what color this reports.
1. It uses the middle of the Sprite
2. It averages all the colors it is touching
3. It averages all the colors on the edge of the Sprite
4. Dropdown of the above. For example:
(color [Sprite1 v] touching at [the middle of the Sprite v] ::sensing)

Support with your choice, or make a choice and I will put it here.

Last edited by sithsiri (Aug. 24, 2015 19:29:03)


Click here for an addition to procd's .sb2 to .exe compiler! It makes the compiler easier to use.
Copy some various emojis and chars from here. It'll come in handy for comments and things: ☁∞πℼ℉℃©®℗™℠§
Find more symbols at www.fsymbols.com
Told you kumquats are nice! That one over there gave me my signature!

9+10=19
Imagine+Program+Share=7+7+5
7+7+5=19
Scratch just makes sense.

Fake link! I used 00a1ff
TheHockeyist
Scratcher
1000+ posts

Color Sensing

Kind of already implented:
<touching color [#ff0000] ?>

But I do see your argument for the block. Just how often would it be used?


Zekrom01
Scratcher
1000+ posts

Color Sensing

Semi-support, just be a little more specific on how the block looks like and how it would work, but as per above, use the
<touching color [#ff0088] ?>
block as a workaround.

20 something years old
Probably doing college work
CatsUnited
Scratcher
1000+ posts

Color Sensing

I don't really understand what your asking, but it sounds like
<touching color [#ff0088] ?>
is a workaround.

bottom text
DaSpudLord
Scratcher
1000+ posts

Color Sensing

No support, what if the sprite is touching multiple colors?


U^ェ^U::motion//This is Blocky. He lives in my signature. He is a trained attack block. He protects my siggy from kumquats.
TheHockeyist
Scratcher
1000+ posts

Color Sensing

DaSpudLord wrote:

No support, what if the sprite is touching multiple colors?

Yeah. This as well.


scrooge200
Scratcher
1000+ posts

Color Sensing

DaSpudLord wrote:

No support, what if the sprite is touching multiple colors?
Zekrom01
Scratcher
1000+ posts

Color Sensing

DaSpudLord wrote:

No support, what if the sprite is touching multiple colors?
This too. Changing to no support.

20 something years old
Probably doing college work
samanyolu
Scratcher
1000+ posts

Color Sensing

scrooge200 wrote:

DaSpudLord wrote:

No support, what if the sprite is touching multiple colors?
koopa_land
Scratcher
100+ posts

Color Sensing


what if the sprite is touching multiple colors?

This looks like Real:

(if <> then [] else [] :: custom-arg)
013506
Scratcher
54 posts

Color Sensing

NO WAY! OMG… i love animated gifs
Will andy pick me?
DON'T COUNT ON IT
sithsiri
Scratcher
100+ posts

Color Sensing

DaSpudLord wrote:

No support, what if the sprite is touching multiple colors?

TheHockeyist wrote:

DaSpudLord wrote:

No support, what if the sprite is touching multiple colors?

Yeah. This as well.

scrooge200 wrote:

DaSpudLord wrote:

No support, what if the sprite is touching multiple colors?

koopa_land wrote:

(Huge image that says “No support” with turtles. Could you use a smaller one?)
what if the sprite is touching multiple colors?
Sorry about that. Check the edit.

013506 wrote:

NO WAY! OMG… i love animated gifs
Will andy pick me?
DON'T COUNT ON IT
????

Last edited by sithsiri (Aug. 24, 2015 19:32:35)


Click here for an addition to procd's .sb2 to .exe compiler! It makes the compiler easier to use.
Copy some various emojis and chars from here. It'll come in handy for comments and things: ☁∞πℼ℉℃©®℗™℠§
Find more symbols at www.fsymbols.com
Told you kumquats are nice! That one over there gave me my signature!

9+10=19
Imagine+Program+Share=7+7+5
7+7+5=19
Scratch just makes sense.

Fake link! I used 00a1ff
1019496
Scratcher
49 posts

Color Sensing

I MEGA support a variation of this. Here is a quote from my post that might solve some problems.
Instead of a long script where this is…
repeat (10)
change y by (10)
long custom block that set (variable) to the color touched
set pen color to (variable)
change y by (-10)
pen down
move (10) steps
pen up
end
You can just do this!
repeat (10)
change y by (10)
set pen color to (color touched block here)
change y by (-10)
pen down
move (10) steps
pen up
end
Now, there might be some problems with this. These are the best answers I can think of.
”If there is a large sprite touching multiple colors, what would it output?”
There are multiple things i can think of for this:
-Outputs the value of the center if the sprite
-Outputs multiple value like the list string output

”How will we make the output user friendly?”
I can think of it outputting either a hexadecimal value or a color like the “if touching (color here)” block


THIS IS A SIGNATURE,
Thanks for viewing this forum post

My profile:
<[may v] contains {(((creativity) * (cRinge)) + (pick random (normal) to (INSANE)))} ?>
See ya later,
-1019496

//end
PitchBlackNights
Scratcher
43 posts

Color Sensing

Sorry for the necro, but I suggested a block like this, and it might be easier to understand
https://scratch.mit.edu/discuss/topic/595639/?page=1

Last edited by PitchBlackNights (April 12, 2022 18:51:26)


This is a new account
Check out my old account: @free_d

ALL OF MY POSTS

Powered by DjangoBB