xxxxxxxxxx
30
let x, y;
function setup() {
createCanvas(720, 400);
// Starts in the middle
x = width / 2;
y = height;
textSize(30);
textAlign(LEFT);
}
function draw() {
background(200);
// Draw a circle
stroke(50);
fill(100);
ellipse(x, y, 24, 24);
y = 150; // this stops the ball from going up
//y = y -1;
x = width/2 + (Math.sin(frameCount/100) * width/2);
noStroke();
text("this is the frameCount: " + frameCount, 50, height / 2);
textSize(20);
text("this is the Math.sin of frameCount divided by 100: " + Math.sin(frameCount/100), 50, 25 + height / 2);
text("this is the value of x: " + x, 50, 50 + height / 2);
}