Created
October 31, 2017 15:12
-
-
Save madbunnykim/b8a9f2d42e8ddabbc2ca2dec57a6704b to your computer and use it in GitHub Desktop.
Ghosts
This file contains 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
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