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 canvas; | |
| var middle; | |
| var paddingAmount; | |
| function setup() { | |
| canvas = createCanvas(windowWidth, windowHeight); | |
| canvas.parent('middle_panel'); | |
| middle = select('#middle_panel'); | |
| resizeCanvas(middle.width, middle.height); | |
| } |
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 ferambie; | |
| function preload() { | |
| ferambie = loadSound('ferambie.mp3'); | |
| } | |
| function setup() { | |
| // uncomment this line to make the canvas the full size of the window | |
| createCanvas(windowWidth, windowHeight); | |
| // the volume is a number between 0 and 1 | |
| ferambie.setVolume(0.5); |
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 mic; | |
| var micOn; | |
| function setup() { | |
| // uncomment this line to make the canvas the full size of the window | |
| createCanvas(windowWidth, windowHeight); | |
| // the volume is a number between 0 and 1 | |
| mic = new p5.AudioIn(); | |
| micOn = false; | |
| } |
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 mic; | |
| var micOn; | |
| var recorder; | |
| var recording; | |
| var soundFile; | |
| function setup() { | |
| // uncomment this line to make the canvas the full size of the window | |
| createCanvas(windowWidth, windowHeight); | |
| // the volume is a number between 0 and 1 |
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 adjustedX; | |
| var adjustedY; | |
| var angle = 0; | |
| var diameter; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| x = width/2; |
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 sprite; | |
| var angle; | |
| var speed; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| sprite = createSprite(width/2, height/2, 50, 50); | |
| speed = 1; | |
| angle = 270; | |
| } |
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 player; | |
| var enemy; | |
| var angle; | |
| var speed; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| player = createSprite(0, 0, 50, 50); | |
| enemy = createSprite(width/2, height/2, 100, 100); |
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 balls = []; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| x = width/2; | |
| y = height/2; | |
| } | |
| function draw() { | |
| background(255,255,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 balls = []; | |
| var gravity = .1; | |
| function setup() { | |
| createCanvas(windowWidth,windowHeight); | |
| } | |
| function draw() { | |
| background(255,255,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
| /* variables declared outside of functions are | |
| are called "global" as they can be referred to | |
| anywhere. */ | |
| var g_variable = 50; | |
| function setup() { | |
| createCanvas(400,400); | |
| /* variables declared inside of a function are | |
| only available in that specific function. |