The Doodle character is actually moving on the _root level. I just move the _root level so that it centers Doodle. Here is the code (easing is also in there):Quote:
adit_ya_sharma wrote on 06-22-2004 10:48 PM:
Nice stuff you got there, how did you do the scrolling in the doodle game and where are you from?:)
code:
_root._x += ((sW/2-this._x)-_root._x)/5;
if (_root._x<sW-_root.map._width) {
_root._x = sW-_root.map._width;
}
if (_root._x>0) {
_root._x = 0;
}
_root._y += ((sH/2-this._y+this._height/2)-_root._y)/5;
sW and sH are the dimensions of the Stage, and "this" is your hero MC.
If you wanted an object to stay a certain distance from the left and top, for example the score and time, you would do this:
code:
_root.s_t._x = -_root._x+10;
_root.s_t._y = -_root._y+10;
That will put MC s_t 10 pixels from the left and 10 pixels from the top.
Hope that helps,
-Frag
PS I'm in the OC
