[ Design ]/Flash
중력표현 스크립트
관이119
2012. 9. 13. 15:49
반응형
무비클립에 스크립트를 넣는다
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;
}

반응형