## test

``````// bouncing ball example

var x, y, dx, dy;
var r = 30; // radius
var g = 0.1; // gravity

var mySnd;

mySnd.setVolume(0.5);
}

function setup() {
createCanvas(400, 400);
x = 200;
y = 40;
dx = 0;
dy = 0;
}

function draw() {
background(200, 220, 250);
fill(0, 250, 0);
ellipse(x, y, r, r);
x = x + dx;
y = y + dy;
var travel_since_bounce = y - (height - r / 2);
if (travel_since_bounce > 0) {
// after bounce we should have gone in the other direction
// so undo travel and travel in the opposite direction,
// therefore we need to subtract travel * 2 from y
y = y - travel_since_bounce * 2;
dy = -dy; // change direction
mySnd.play();
}
dy = dy + g; // gravity
}
``````

## What is the largest canvas size on WordPress?

This is a test. Line spacing is 100.

``````function setup() {
createCanvas(800, 800);
}

function draw() {
background(200, 200, 150);
for (var i = 0; i <= 800; i += 100) {
line(i, 0, i, 800);
line(0, i, 800, i);
}
noLoop();
}
``````

## Sound Test

Sound Test

type 1 2 3 4 to sketch to play sounds

``````var one, two, three, four;

}

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();

}

``````