So I made this on khan-academy and want to put it on my website.
https://www.khanacademy.org/cs/fade-away/4830224329998336
To convert this to JavaScript I put the code below in. Unfortunately I get the error: you are mixing active and static modes. Why does this work on Khan Academy Processing and not in normal Processing? Also what other ways can I write this to make it work?
//don't forget to click!!!
background(2, 3, 3);
strokeWeight(2);
var x = random;
void setup(){
size(500,500);
}
void draw(){
fill(0, 0, 0, 20);
rect(0,0, 400,400);
var randomSize = random(20, 60);
if (mouseIsPressed) {
noStroke();
fill(random(0, 255), random(0, 255), random(0, 255), 373);
}
else {
noStroke();
fill(255, 0, 0, 15);
randomSize=50;
}
ellipse(mouseX, mouseY, randomSize, randomSize);
};