We are doing CS Discoveries Unit 5 - Variables (Animation/gaming lab). The one lesson shows you how to create a color variable and call it. When the kids create their own color variables in another sub lesson it says they aren’t calling the variable. Why would that be.
Example:
var color1 = “tan”
fill(“tan”)
This should work, but it says the variable isn’t being called.
Not sure if I understand your problem, but if it’s that you get the error “color1 is defined, but it’s not called in your program”, then it can be fixed by calling color1 instead of hard-coding a value:
It does not say it’s not defined. It says it isn’t being used, which is not true. I have kids that have the same code and it works for one but not the other. This is actually the first time I have ever had this occur on this particular lesson.
Yes, @Binary_Coder is correct. You created the color1 variable and gave it a value of “tan”. To use the variable, you should reference the variable name color1.
If you are having issues with other lessons, post a shared link to the code and we’ll take a look to see why there may be an error.