Hello, @xiquip, and welcome to the Processing Forum!
Be careful with spelling in your program. Notice that you have this:
var triancle Y =
Please fix the spelling, and be aware that the name of a variable cannot include a space.
A useful resource for p5.js programmers is the p5.js Reference.
That reference contains this: Reference: random()
. An alpha value can range from 0
to 255
, inclusive. It should be a whole number.
Let’s first see if you can use the information in the reference to assign an appropriate random number to triangleOpacity
in your program. That will serve as the alpha value. Please post the statement that accomplishes that task here, and we will help you with refining it, as necessary.
For your program to execute, you will need to correct all the spelling mistakes, as well as assign values to all the variables. For example, you can do this:
var triangleX = 120;
Edited on March 25, 2021 to add the following:
Your posted code is difficult to read, since it is not formatted properly for posting. See Guidelines—Asking Questions for lots of useful advice, including information on how to format code for posting.