xxxxxxxxxx
g=1000;
y=0;
vy=0;
t=0.05;
function setup() {
frameRate(20);
createCanvas(400, 400);
background(255);
}
function draw() {
circle(200, y, 20);
vy=vy+g*t;
y=y+vy*t;
}
//x=10;
//vx=20;
//t=0.05;
//function setup() {
// frameRate(20);
// createCanvas(400, 400);
// background(255);
//}
//function draw() {
// background(255);
// x=x+vx*t //현재 위치+초당 거리
// circle(x, 200, 20);
// if(x<10){
// vx=-vx;
// }
// vx=-vx;
// }
//}