Emma N-M LO-1 (test)

Hello world.

sketchMaybe

function setup() {
    createCanvas(320, 240);
    background(220);
}

function draw() {
    rect(10, 10, 40, 50);
}

sketch

function setup() {
    createCanvas(200, 202);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
	rect(50,50, 30, 20);
	fill("blue");
	text("Hello world!", 70, 30);
	ellipse(100, 100, 50, 30);
}

Sound Test


Sound Test

type 1 2 3 4 to sketch to play sounds

playfour

var one, two, three, four;


function preload() {
    one = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/one.wav");
    two = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/two.wav");
    three = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/three.wav");
    four = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/four.wav");
}


function setup() {
    createCanvas(200, 200);
    background(200);
}

function keyPressed() {
    print("" + keyCode);
    if (keyCode == 49) one.play();
    else if (keyCode == 50) two.play();
    else if (keyCode == 51) three.play();
    else if (keyCode == 52) four.play();

}