xxxxxxxxxx
28
// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
let wave0;
let wave1;
function setup() {
createCanvas(640, 360);
colorMode(RGB, 255, 255, 255, 100);
// Initialize a wave with starting point, width, amplitude, and period
wave0 = new Wave(createVector(50,75),100,20,500);
wave1 = new Wave(createVector(300,100),300,40,220);
}
function draw() {
background(51);
// Update and display waves
wave0.calculate();
wave0.display();
wave1.calculate();
wave1.display();
}