Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ghosts
let footprint;
let footprint2;
// let ripple;
let mic;
let ghost;
function preload() {
// ghost = createVideo('shadow_finalver.mov');
footprint = loadImage("footprint.png");
footprint2 = loadImage("footprint2.png");
// ripple = loadImage("ripple.png");
}
function setup() {
createCanvas(windowWidth, windowHeight);
mic = new p5.AudioIn()
mic.start();
}
function draw() {
background(255);
let vol = mic.getLevel();
let x = random(width / 2 - vol*100, width / 2 + vol*100);
let y = constrain(height - vol * height * 5, 0, height);
// // ripple.loadPixels();
// // for (var i = 0; i < ripple.pixels.length; i++) {
// // ripple.pixels[i] *= 1.0;
// // }
// // ripple.updatePixels();
// imageMode(CENTER);
// image(ripple, width / 2, height / 2, 800, 800);
image(footprint, x-50, y-50, footprint.width, footprint.height);
tint(201, 232, 149, 128);
image(footprint2, x+100, y+200, footprint.width, footprint.height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment