xxxxxxxxxx
51
var r=10; // Current radius of the circle
var convert=1.8; // Converting from "size" to "miles"
var xarr=[]; // Array of x points for starting points
var yarr=[]; // Array of y points for starting points
function preload ()
{
img = loadImage("./Map.png");
}
function setup() {
createCanvas(1700, 900);
image(img, 0,0)
}
function draw() {
background(255);
image(img, 0,0);
for(var i=0; i<xarr.length; i++)
{
noFill();
circle(xarr[i], yarr[i], r);
}
fill(0);
text("Miles: " + floor(r/convert), 1600, 800);
}
function mousePressed()
{
xarr.push(mouseX);
yarr.push(mouseY);
}
function keyPressed()
{
switch(keyCode)
{
case 38: r+=10;
break;
case 40: r-=10;
break;
}
}