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
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script language="javascript" type="text/javascript" src="../p5.js"></script> | |
| <!-- uncomment lines below to include extra p5 libraries --> | |
| <script language="javascript" src="../addons/p5.dom.js"></script> <!--<script language="javascript" src="../addons/p5.sound.js"></script>--> | |
| <script language="javascript" type="text/javascript" src="sketch.js"></script> | |
| <!-- this line removes any default padding and style. you might only need one of these values set. --> | |
| <style> | |
| #left_panel { |
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
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script language="javascript" type="text/javascript" src="../p5.js"></script> | |
| <!-- uncomment lines below to include extra p5 libraries --> | |
| <script language="javascript" src="../addons/p5.dom.js"></script> <!--<script language="javascript" src="../addons/p5.sound.js"></script>--> | |
| <script language="javascript" type="text/javascript" src="sketch.js"></script> | |
| <!-- this line removes any default padding and style. you might only need one of these values set. --> | |
| <style> | |
| #left_panel { |
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 Ball = function() { | |
| this.x = random(width); | |
| this.y = random(height); | |
| this.speedX = random(-1,1); | |
| this.diameter = random(20,50); | |
| } | |
| var balls = []; | |
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 Ball = function(x, y) { | |
| this.x = x; | |
| this.y = y; | |
| this.diameter = 10; | |
| } | |
| Ball.prototype.show = function() { | |
| ellipse(this.x, this.y, this.diameter, this.diameter); | |
| } |
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 Ball = function(x, y) { | |
| this.x = x; | |
| this.y = y; | |
| this.diameter = 10; | |
| } | |
| var balls = []; | |
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 Ball = function() { | |
| this.x = mouseX; | |
| this.y = mouseY; | |
| this.diameter = 10; | |
| } | |
| var balls = []; | |
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 ball = { x: 50, | |
| y: 50, | |
| diameter: 50 | |
| }; | |
| function setup() { | |
| createCanvas(windowWidth, windowHeight); | |
| } |
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 xPoints = []; | |
| var yPoints = [] | |
| function setup() { | |
| createCanvas(windowWidth, windowHeight); | |
| } | |
| function draw() { | |
| background(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(windowWidth, windowHeight); | |
| } | |
| function draw() { | |
| background(0); | |
| noFill(); | |
| stroke(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
| var dots = []; | |
| function setup() { | |
| createCanvas(windowWidth, windowHeight); | |
| for (var i = 0; i < 10; i++) { | |
| dots.push(random(10,50)); | |
| } | |
| } |