Discuss Scratch

mazed651
New Scratcher
2 posts

Change Color Effect by 25

Hello,

I am changing the Sprite color using “Change Color Effect by 25” function, and it is working. Next I am using “If then” and “touching color –” function to perform an action based on the changed color. When I used the “Change Color Effect by 25” function it is changing the sprite color but don't know the exact color to use in “touching color –” function.

Example: the initial sprite color is red(for example), and using the “Change Color Effect by 25”, the sprite is changing to “Green” but this green could be any green.

Any help would be appreciated.

Thanks,

Mazed

The_Grits
Scratcher
1000+ posts

Change Color Effect by 25

mazed651 wrote:

Hello,

I am changing the Sprite color using “Change Color Effect by 25” function, and it is working. Next I am using “If then” and “touching color –” function to perform an action based on the changed color. When I used the “Change Color Effect by 25” function it is changing the sprite color but don't know the exact color to use in “touching color –” function.

Example: the initial sprite color is red(for example), and using the “Change Color Effect by 25”, the sprite is changing to “Green” but this green could be any green.

Any help would be appreciated.

Thanks,

Mazed

This would fit better in the ‘Help with Scripts’ forum, I'll ask a mod to move the topic for you.
footsocktoe
Scratcher
1000+ posts

Change Color Effect by 25

You use the eyedropper associated with the touching color block to determine the color.

Run the script (changing it if you have to) so that the sprite is on the stage with the new color. Now touch the “if color =” square of the touching color block and then touch the new color on the stage so that it is now in the “if touching color” block.
BKFighter
Scratcher
1000+ posts

Change Color Effect by 25

The best solution (unless I'm missing some block…) is to do something like this:
when green flag clicked
set [color var v] to [0]
forever
set [color var v] to ((color var) mod (200))//200 was the maximum number right? otherwise change it too that....
set [color v] effect to (color var)
end
//So then you can use the color var variable to set the color effect, and you also can just use it to find the number
So just change the variable color var instead of the effect block.
drmcw
Scratcher
1000+ posts

Change Color Effect by 25

The colour effect block uses HSL colours whereas the touching colour block uses RGB. Why not just use
<t
<touching [sprite v] ?>
? Although slow it's still quicker than touching colour.
cs161404
Scratcher
18 posts

Change Color Effect by 25

when green flag clicked
if <touching ?> then
change [ color] effect by (25)
end
at least this worked for me
cs161404
Scratcher
18 posts

Change Color Effect by 25

when green flag clicked
if <the world ends> then
say [hooray] for (2) secs

end
if <i am awesome> then
think [i am awesome tooo!] for (2) secs

end
asivi
Scratcher
1000+ posts

Change Color Effect by 25

mazed651 wrote:

Hello,

I am changing the Sprite color using “Change Color Effect by 25” function, and it is working. Next I am using “If then” and “touching color –” function to perform an action based on the changed color. When I used the “Change Color Effect by 25” function it is changing the sprite color but don't know the exact color to use in “touching color –” function.

Example: the initial sprite color is red(for example), and using the “Change Color Effect by 25”, the sprite is changing to “Green” but this green could be any green.

Any help would be appreciated.

Thanks,

Mazed

Then based in

BKFighter wrote:

The best solution (unless I'm missing some block…) is to do something like this:
when green flag clicked
set [color var v] to [0]
forever
set [color var v] to ((color var) mod (200))//200 was the maximum number right? otherwise change it too that....
set [color v] effect to (color var)
end
//So then you can use the color var variable to set the color effect, and you also can just use it to find the number
So just change the variable color var instead of the effect block.

and

drmcw wrote:

The colour effect block uses HSL colours whereas the touching colour block uses RGB. Why not just use
<t
<touching [sprite v] ?>
? Although slow it's still quicker than touching colour.

you may to use
if <<touching [sprite v] ?> and <(color var) = [the value associated to an action]> > then

end

Greets.
mazed651
New Scratcher
2 posts

Change Color Effect by 25

Hello drmcw,

worked, thanks much.
cs300929
Scratcher
100+ posts

Change Color Effect by 25

Guys, you've got this all worng. It's quite simple.
when green flag clicked
forever

if <touching color [#ff0088] ?> then
clear graphic effects

end

end
deck26
Scratcher
1000+ posts

Change Color Effect by 25

cs300929 wrote:

Guys, you've got this all worng. It's quite simple.
when green flag clicked
forever

if <touching color [#ff0088] ?> then
clear graphic effects

end

end
I don't think you've understood the question.

Powered by DjangoBB