Wednesday, September 15, 2010

Processing: ballを止める

Ballクラスにboolean on_colliitonを持たせる
mag(x, y)はdist(0, 0, x, y)と等価

    if (mag(vx, vy) < 0.3 && on_collition){
      vx = vy = 0;
    }
    on_collition = false;

No comments: