s

부드러운 움직임

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

// 부드러운 움직임
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건
+
제목 글쓴이 날짜 조회
09-09-11 조회 5,806
09-08-14 조회 5,304
09-07-24 조회 5,995
09-07-17 조회 4,008
09-06-26 조회 5,220
09-06-25 조회 4,145
09-06-18 조회 5,380
09-05-16 조회 3,841
09-04-30 조회 3,439
09-04-02 조회 7,279
09-03-10 조회 3,414
09-01-30 조회 2,912
09-01-25 조회 3,586
09-01-24 조회 3,691
09-01-23 조회 3,864
09-01-20 조회 5,876
09-01-20 조회 4,310
09-01-14 조회 5,278
09-01-10 조회 3,099
09-01-09 조회 2,989
09-01-06 조회 2,939
09-01-05 조회 5,192
08-12-29 조회 4,361
08-12-20 조회 3,927
08-12-13 조회 4,539
08-12-12 조회 4,613
08-12-11 조회 2,725
08-11-26 조회 4,597
08-11-25 조회 3,721
08-11-25 조회 2,910
08-11-25 조회 4,475
08-11-25 조회 4,354
08-11-21 조회 4,348
08-11-20 조회 3,709
08-11-19 조회 3,984
08-11-19 조회 4,232
08-11-18 조회 4,005
08-11-15 조회 2,879
08-11-14 조회 3,240
08-11-13 조회 3,865
08-11-12 조회 9,999
08-02-22 조회 5,664
08-02-21 조회 4,605
08-02-21 조회 7,110