xxxxxxxxxx
78
var img;
function preload(){
img=loadImage('/awacs.jpeg');
}
function setup() {
createCanvas(500, 500);
angleMode(DEGREES)
}
var domesize=85;
var a=0;
function draw() {
var domex=(width/4)+46;
var domey=(height/2-domesize/2)+42;
background('skyblue');
image(img, 0,25);
// line(0, height/2, width, height/2); // Center Cross Line
//line(width/2, 0, width/2, height); // Center Cross Line
//line(domex, height/2-19, width-(width/5), height/2-19) // Left fuse
//line(domex, height/2+19, width-(width/5), height/2+18) // right fuse
fill(0);
push();
translate(domex, domey)
rotate(a)
arc(0,0, domesize,domesize, 0, 360);
rectMode(CENTER);
fill(255);
noStroke();
rect(0,0, domesize*0.3, domesize)
fill(255);
stroke(0);
pop();
a++;
}
function mousePressed()
{
//console.log(mouseX, mouseY);
img.loadPixels();
for(i=mouseX-20; i<mouseX+20; i++)
{
for(j=mouseY-50; j<mouseY; j++)
{
tint(0,0);
img.set(i,j, 255,255,255,255);
//console.log("HER");
}
}
img.updatePixels();
}
function keyPressed()
{
//save(img, 'awacs.jpeg');
}