xxxxxxxxxx
var bunker = [];
var balls;
function setup() {
createCanvas(windowWidth, windowHeight);
bunker = new PixelBunker();
balls = new Ball();
}
function draw() {
background(255);
loadPixels();
bunker.display();
updatePixels();
balls.display();
}
function PixelBunker() {
this.display = function() {
for (var y = 0; y < 100; y++) {
for (var x = 0; x < 50; x++) {
var index = (x + y * width) * 4;
pixels[index + 2292200] = 18;
pixels[index + 2292201] = 68;
pixels[index + 2292202] = 14;
pixels[index + 2292203] = 255;
}
}
}
}
function Ball(){
this.display = function(){
noStroke();
fill(255, 255, 255, 150);
ellipse(mouseX, mouseY, 20, 20);
}
}