BlueFadeTotalLoop Actionscript
Table of contents | Previous document | Download BlueFadeTotalLoop.as | SWF!T Homepage RCSfile: BlueFadeTotalLoop.as,v Revision: 1.2 Date: 2003/02/27 23:25:55
Copyright 2003 Orgdot AS. All Rights Reserved. http://dev.swfit.com
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Keeps track of the roller movements.
author Olaf Havnes
version Revision: 1.2 Date: 2003/02/27 23:25:55
since SWFIT1.0
Should we start the roller ?
if (stage == END_STAGE || stage == ROLL_STAGE)
{
d = Y_REST - yp;
y_speed += spring * d - friction * y_speed;
yp += y_speed;
if (stage == ROLL_STAGE)
{
if (y < Y_REST)
{
First time we pass the rest point we go to the end stage
stage = END_STAGE;
end_counter = 0;
}
}
else if (stage == END_STAGE)
{
Finish the bounce in the roller
end_counter++;
if (end_counter > END_STEPS)
{
yp = Y_REST;
stage = REST_STAGE;
/:do_roll = false;
}
}
}
else if (stage == WAIT_STAGE)
{
wait_counter ++;
if (wait_counter > WAIT_STEPS)
{
stage = ROLL_STAGE;
y_speed = ROLL_SPEED_START;
}
}
else if (stage == WIND_STAGE)
{
yp += WIND_SPEED;
if (yp > Y_WIND)
{
stage = WAIT_STAGE;
wait_counter = 0;
}
}
else if (stage == REST_STAGE)
{
if (/:do_roll)
{
stage = WIND_STAGE;
}
}
Move the roller
y = int (yp);
roller._y = y;
Move the gradient
if (stage == WIND_STAGE)
{
grad._y = y;
grad._visible = true;
}
else
{
grad._visible = false;
}
|
|