s

부드러운 움직임

· 2008-03-28 (금) 10:17:04 · 2599

// 부드러운 움직임
MovieClip.prototype.smoothMove = function(speed,targetX,targetY){
        this._x += speed*(targetX - this._x);
        this._y += speed*(targetY - this._y);
};

//회전운동
MovieClip.prototype.rotateTo = function(targetX,targetY){
        var diffX = targetX - this._x;
        var diffY = targetY - this._y;
        this._rotation = Math.atan2(diffY,diffX)*180/Math.PI;
};

//탄성력
MovieClip.prototype.elasticMove = function(a,b,tx,ty){
        var tempx = this._x;
        var tempy = this._y;
        this._x = a*(this._x - tx) + b*(this.prevx - tx) + tx;
        this._y = a*(this._y - ty) + b*(this.prevy - ty) + ty;
        this.prevx = tempx;
        this.prevy = tempy;
};

[이 게시물은 관리자님에 의해 2011-10-31 16:50:06 Flash에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
12-01-11 조회 2,755
12-01-11 조회 1.2만
12-01-10 조회 2,852
12-01-08 조회 3,445
12-01-05 조회 5,336
11-12-29 조회 3,054
11-12-27 조회 2,839
11-12-25 조회 3,022
11-12-22 조회 3,457
11-12-14 조회 2,921
11-12-12 조회 3,541
11-11-28 조회 3,377
10-10-19 조회 2,837
08-09-05 조회 3,756
08-09-05 조회 3,572
08-06-14 조회 3,315
08-04-22 조회 3,593
08-04-17 조회 3,599
07-10-03 조회 4,213
07-10-03 조회 3,609
07-10-03 조회 7,291
07-10-03 조회 4,569
07-10-03 조회 3,265
07-10-03 조회 2,856
07-10-02 조회 3,571
07-10-02 조회 3,101
07-09-27 조회 5,022
07-09-27 조회 3,847
06-09-26 조회 3,516
06-09-26 조회 4,733
06-09-22 조회 3,908
06-09-22 조회 3,524
06-09-22 조회 4,269
06-09-21 조회 4,204
06-08-18 조회 3,694
05-11-30 조회 4,745
05-07-15 조회 4,592
05-03-23 조회 4,655
05-03-14 조회 3,322
05-03-13 조회 2,697
04-08-05 조회 5,770