xxxxxxxxxx
54
let myBall;
let myBall2;
function setup() {
createCanvas(400, 400);
let x = width/2;
let y = width/2;
let mySpeed = {
x: 0,
y: 0
};
let mySpeed2 = {
x: 5,
y: 5
}
myBall = new Ball(x, y, mySpeed);
mySpeed.x = 5;
mySpeed.y = 5;
myBall2 = new Ball(width/4, height/4, mySpeed2);
// x = 0;
}
function draw() {
background(220);
myBall.show();
myBall.update();
myBall2.show();
myBall2.update();
}