xxxxxxxxxx
var colors;
var cardColor;
var time = 0;
var cards;
function setup() {
createCanvas(windowWidth, windowHeight, WEBGL);
cards = [];
for (let i=0; i<8; i++)
cards.push(new Card(
200*cos(TAU*i/8),200*sin(TAU*i/8), 100,150,
color(random(100,255),random(100,255),random(100,255))));
}
function draw() {
background(0);
for (let card of cards){
var v = createVector((mouseX-width/2)-card.x, (mouseY-height/2)-card.y);
var d = 1.5*Math.PI*v.mag()/height;
v.normalize();
card.drawCard(min(d, 0.75*Math.PI), v.x, v.y);
}
}