xxxxxxxxxx
30
var sizeS = 0;
var sizeB = 0;
function setup() {
createCanvas(400, 400, WEBGL);
}
function draw() {
background(255);
strokeWeight(3);
noFill();
rotateY(mouseY/100);
rotateX(mouseX/100);
stroke(230, 115, 157);
sphere(250 + sizeS);
sphere(100 + sizeS);
sphere(25 + sizeS);
stroke(90, 158, 95);
box(200 + sizeB);
box(90 + sizeB);
if(keyIsDown(UP_ARROW)){
sizeS = sizeS + 0.5;
sizeB = sizeB + 0.7;
}
if(keyIsDown(DOWN_ARROW)){
sizeS = sizeS - 0.5;
sizeB = sizeB - 0.7;
}
}