sr. member
Activity: 378
Merit: 250
Pre-sale - March 18
So I had been learning processing.js from two different sources, first I started using Khan Academy and I also had been learning from processing.org
Now both had taught two different codes, the once from Khanacademy:
background(252, 255, 214);
noStroke();
// position of the car
var x = 10;
// draw the car body
fill(255, 0, 115);
rect(x, 200, 100, 20);
rect(x + 15, 178, 70, 40);
// draw the wheels
fill(77, 66, 66);
ellipse(x + 25, 221, 24, 24);
ellipse(x + 75, 221, 24, 24);
var draw = function() {
// this is the draw loop! everything inside these
// brackets will be run over and over again.
};
Then Codes like this from Processing.org:
oid setup() {
size(500, 400);
background(10, 80, 100);
}
void draw() {
if (mousePressed) {
background(10, 80, 100);
}
stroke(255, 255, 255);
fill(160, 220, 90);
ellipse(mouseX, 200, 300, 300);
fill(160, 210, 230);
rect(245, mouseY, 10, 240);
fill(255, 255, 255);
ellipse(mouseX, mouseY, 70, 70);
}
So I used both these codes on a processing app builder and the one from Khan Academy dont work. They both have different setup, Is the Khanacademy learning outdated?