부드러운 움직임

DEV_FLASH 2007. 6. 7. 17:14 |

오리와깃발사이의 거리 = targetX - this._x

this._x = this._x + 0.1*(targetX - this._x)



_root.bnUp.onPress = function(){
 _root.beetle._rotation=0;
 _root.beetle.onEnterFrame = function(){
  this._y = this._y -5;
 };
};

_root.bnRight.onPress = function(){
 _root.beetle._rotation = 90;
 _root.beetle.onenterFrame = function(){
  this._x = this._x+5;
 };
};
_root.onMouseUp = function(){
 _root.beetle.onEnterFrame = null;
};


//위의 경우 4번이면 4번다 써줘야 하지만, 아래를 이용하면 한번만 해주면 된다.

_root.bnRight.onRelease = function(){
 _root.beetle.onEnterFrame = null;
};

Posted by 으니가저아
: