xxxxxxxxxx
45
var video;
var size;
var dimensionX = 640;
var dimensionY = 480;
var direction = 1;
var block = {
x: 0,
y:0,
sizeX:0,
sizeY: 0
}
var rotations = [];
function setup() {
createCanvas(dimensionX, dimensionY);
// video = createCapture(VIDEO);
// video.size(320, 240);
// video.hide();
//var randSeed =(round(random(2,10)));
//randSeed = 2
//size = dimension/randSeed;
background(0);
frameRate(1);
block.sizeX = width/8;
block.sizeY = height/6;
}
function draw() {
if ((block.x == width) || ((block.x == -80)&&direction<0)) {
direction = -direction;
block.x = block.x + direction*block.sizeX;
block.y += block.sizeY;
}
// image(video, block.x,block.y,block.sizeX,block.sizeY);
rect(block.x,block.y,block.sizeX,block.sizeY);
block.x =block.x + direction*block.sizeX;
if(mouseX>block.x --- how do i reference a rect?
neither are we using for loop nor are we using an array
i think we should use an array
another idea could be to use a virtual 'window'
}