xxxxxxxxxx
34
// variables
// by Yatharth
// This code is based on everything I learned from
// Daniel Shiffman (https://thecodingtrain.com)
let circleX = 0;
let circleRadius = 50;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(0);
noStroke();
fill(255);
// drawing a circle at the co-ordinates (circleX, height / 2) with a radius "circleRadius"
circle(circleX, height / 2, circleRadius);
// incrementing the circle's x location by 1
circleX++;
// circleX = circleX + 1;
}
function mousePressed() {
// incrementing the circle's radius by 5 whenever the mouse is pressed
circleRadius += 5;
// circleRadius = circleRadius + 5;
}