xxxxxxxxxx
35
class Comment{
constructor()
{
this.x = random(100);;
this.y = 0;
}
getX(){
return this.x;
}
getY(){
return this.y;
}
setX(_x){
this.x = _x;
}
}
var comments = [];
function setup() {
createCanvas(400, 400);
for( var i = 0; i < 10; i++ ){
comments[i] = new Comment();
}
frameRate(1);
}
function draw() {
background(220);
fill(0,0,0,100);
text("hello", 100,100);
for( var i = 0; i < 1; i++ ){
comments[i].setX(random(10));
print(comments[i].getX());
}
}