xxxxxxxxxx
48
let x = 0;
let speed = 5;
let Vspeed;
let y = 0;
function setup() {
createCanvas(400, 400);
}
function draw()
{
background(220);
noFill();
if (x >= width - 25)
{
speed = -5;
}
else if (x <= 0)
{
speed = 5;
}
x += speed;
fill(255,0,0);
strokeWeight(0)
circle(x, height/2, 50);
/////////////////////////////////////////
if (y >= height - 25)
{
Vspeed = -10;
}
else if (y <= 0)
{
Vspeed = 10;
}
y += Vspeed;
circle(width/2,y,50)
// circle(random(width), random(height), 50)
// circle(random(width), random(height), 50)
}