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 y = 0; | |
var isEllipse = true; | |
function setup() { | |
createCanvas(600, 400); | |
rectMode(CENTER); | |
} | |
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
var d; | |
var dots = []; | |
var increment2 = 0.001; | |
function setup() { | |
createCanvas(windowWidth, windowHeight); | |
// LM: use double for loops to create a grid to determine x and y positions | |
for (var i=0; i<10; i++) { | |
for (var j=0; j<10; j++) { |
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
int ledPin = 13; // LED connected to digital pin 13 | |
int inPin = 7; // pushbutton connected to digital pin 7 | |
int val = 0; // variable to store the read value | |
void setup() { | |
Serial.begin(9600); | |
pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output | |
pinMode(inPin, INPUT); // sets the digital pin 7 as input | |
} |
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 bobAudio; | |
var annAudio; | |
function preload() { | |
bobAudio = loadSound('beatbox.mp3'); | |
annAudio = loadSound('beatbox.mp3'); | |
} | |
function setup() { | |
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; | |
var y = 0; | |
var easing = 0.05; // smaller means slower follow, bigger means faster follow | |
function setup() { | |
createCanvas(600, 400); | |
x = mouseX; | |
y = mouseY; | |
noFill(); | |
} |
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 y = 259; | |
function setup() { | |
createCanvas(600, 400); | |
angleMode(DEGREES); | |
} | |
function draw() { | |
background(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
//// PART ONE: VARIABLES | |
// COMMENTS | |
function setup() { | |
createCanvas(300, 200); | |
} | |
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
// Example 1-1: stroke and fill | |
function setup() { | |
createCanvas(480, 270); | |
stroke(0); | |
fill(150); | |
} | |
function draw() { | |
background(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
///////////////////////////////////////////////////////////////// | |
// basic button | |
var button; | |
function setup() { | |
createCanvas(640, 480); | |
noLoop(); | |
colorMode(HSB); |
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
/////////////////////////////////////////////////////// | |
//// 02_variables_loops | |
// 1. Map out grid, logic of laying bricks on whiteboard. | |
// 2. Create variables. | |
var brickWidth = 40; | |
var brickHeight = 15; | |
var columnOffset = 60; | |
var rowOffset = 30; |