xxxxxxxxxx
42
var Windy = function (_x1, _y1,_x2, _y2,_x3,_y3){
this.x1 = _x1;
this.y1 = _y1;
this.x2 = _x2;
this.y2 = _y2;
this.x3 = _x3;
this.y3 = _y3;
this.x1dir = random (-1,1);
this.y1dir = random (-1,1);
thi.draw = function (){
triangle (this.x1, this.y1)
};
};
this.draw = function (){
ellipse (this.x, this.y, 50, 50);
};
//this.move
var aball;
var bball;
function setup() {
createCanvas(400, 400);
aball = new Ball (width/2, height/2);
bball = new Ball (10,10);
}
function draw() {
background(220);
ellipse (aball.x, aball.y, 50,50);
ellipse (bball.x, bball.y, 50, 50);
}