본문 바로가기
[ Design ]/Flash

중력표현 스크립트

by 관이119 2012. 9. 13.
Urban Stereo | fitsys
http://blog.naver.com/fitsys/80003153777

무비클립에 스크립트를 넣는다

onClipEvent(load){
fscommand("allowscale",false);

gravity=3;
friction=.96;
floor = 200;
radius=this._height/2;
}

onClipEvent(enterFrame){

if ( this._y + velocity + radius >= floor){
this._y = floor - radius;
velocity = -velocity;

}else{
_y += velocity;
}

velocity= (velocity+gravity)*friction;
}


'[ Design ] > Flash' 카테고리의 다른 글

플래시에서 폰트를 깨끗하게 사용하는 팁  (0) 2012.09.13
문자열 오브젝트 (String)  (0) 2012.09.13
탄력있는 버튼  (0) 2012.09.13
감/가속도 공식  (0) 2012.09.13
투명swf 파일 무비 삽입하기  (0) 2012.09.13

댓글