Discuss Scratch

taco_is_an_idiot
Scratcher
3 posts

Rainbow Pen? I need some help

TACO_IS_AN_IDIOT
HE/HIM or XE/XEM



LINK_TO_MY_PROJECT
hey scratchers, i've made a simple drawing engine in scratch. i am now attempting to create a rainbow effect as a pen preset. i am able to create this effect, but that means it will add that effect to all the colours, which i hate the look of.
 
can someone who has tackled a similar problem please help me? i have no idea what im doing lol :/

this is what i have basically done to create the pen effect

when I receive [ v]
repeat until <>
forever
change pen color by (10)
end
end

idk whats up with my code
plz help
TheNoisyNoisy
Scratcher
100+ posts

Rainbow Pen? I need some help

ok ima try

Last edited by TheNoisyNoisy (June 13, 2024 02:44:14)

octopuswinslow
Scratcher
1000+ posts

Rainbow Pen? I need some help

when I receive [ v]
set [variable v] to [1]
repeat until <(variable) = [0]>
change pen color by (10)
end
Set “variable” or whatever you want to call it to 0 each time another button that isn't the rainbow button is clicked.

Hopefully I have understanded what you meant correctly.

Last edited by octopuswinslow (June 13, 2024 02:53:45)

TheNoisyNoisy
Scratcher
100+ posts

Rainbow Pen? I need some help

https://scratch.mit.edu/projects/1036597204/
i also added:
double click the white to erase all
now you cant draw outside the canvas
Sir-Cats-A-Lot
Scratcher
30 posts

Rainbow Pen? I need some help

This is how I'd get out of this conundrum:

// Before any of this, I'd set the "color" variable to the old color by using it as the value, as shown here:

set pen [color v] to (color) :: pen

// For the rainbow itself, I'd use these blocks somewhere:

broadcast (Start Rainbow v)

broadcast (Stop Rainbow v)

//Then, I'd use these scripts to toggle the rainbow effect:

when I receive [Start Rainbow v] :: events hat
set [rainbow? v] to [y] :: variable
set pen [color v] to [0] :: pen
repeat until <(rainbow?) = [n]>
change pen [color v] by [10] :: pen
end

when I receive [Stop Rainbow v] :: events hat
set [rainbow? v] to [n] :: variable
set pen [color v] to (color) :: pen
OliverOcelot15
Scratcher
4 posts

Rainbow Pen? I need some help

i do not know what is even heppen

Powered by DjangoBB