xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(220);
}
const connectedCubeArray = [];
function draw() {
const cubeP = connectedCubeArray[0];
const cubeQ = connectedCubeArray[1];
// Keep on gazing at the othre Cube
const spd = 115;
cubeP?.turnToCube( cubeQ, spd );
}
function mouseClicked() {
P5tCube.connectNewP5tCube().then( cube => {
connectedCubeArray.push( cube );
cube.turnLightOn( 'white' );
} );
}