This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x = 0; | |
| function setup() { | |
| createCanvas(400,400); | |
| /* variables declared inside of a function are | |
| only available in that specific function. | |
| */ | |
| } | |
| function draw() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var r = 400; | |
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| background(0,0,0); | |
| ellipse(width/2, height/2, r, r); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var r = 400; | |
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| background(0,0,0); | |
| var r = 50 + (frameCount%30); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var r = 0; | |
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| background(255); | |
| r = frameCount%255; | |
| fill(r, 0, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| var x = random(width); | |
| var y = random(height); | |
| fill(127,10); | |
| stroke(100,90); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x; | |
| var y; | |
| var r; | |
| var g; | |
| var b; | |
| function setup() { | |
| createCanvas(400,400); | |
| y = 0; | |
| r = random(255); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| r = random(255); | |
| g = random(255); | |
| b = random(255); | |
| x = random(width); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var something = "Hello"; | |
| function setup() { | |
| createCanvas(400,400); | |
| something = something + " World"; | |
| console.log(something); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setup() { | |
| createCanvas(400,400); | |
| } | |
| function draw() { | |
| console.log("Random Number Between 5 and 10: " + random(5,10)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setup() { | |
| createCanvas(windowWidth, windowHeight); | |
| } | |
| function draw() { | |
| background(255); | |
| var x = width/2; | |
| var y = height/2; | |
| var circleWidth = map(mouseX, 0, width, 0, 100); | |
| var circleHeight = map(mouseX, 0, width, 0, 100); |