Discuss Scratch

MeganESnedeker
Scratcher
2 posts

Asking Users to Input a Color With the PEN Extension?

Hello!

I'm attempting to create a fairly simple script for a class, and I wanted to add some engagement and interest to it by letting users pick the colors of the pen. As an example, I'm creating a script that draws a building with some trees using the pen extension, and I'd like to have the sprite ask the user what color they want the windows to be, and have the pen change to match that.

I've tried using:

(Set pen color to <answer>)

But when inputting colors, it doesn't work and the pen just defaults to black. I've tried using numbers as well as words for the answer, and neither work.

I was wondering if there's a way to do this that I haven't been able to think of, or if this is even possible with the Pen Extension?

Thanks for any advice!
deck26
Scratcher
1000+ posts

Asking Users to Input a Color With the PEN Extension?

See https://scratch.mit.edu/projects/282969197/

You can either keep the colours and codes in one list or have two lists so item 3 in the colours list is specified by the code in item 3 in the second list.
MeganESnedeker
Scratcher
2 posts

Asking Users to Input a Color With the PEN Extension?

deck26 wrote:

See https://scratch.mit.edu/projects/282969197/

You can either keep the colours and codes in one list or have two lists so item 3 in the colours list is specified by the code in item 3 in the second list.

Thank you so much! That worked perfectly!

Powered by DjangoBB