BubbleTroubleLoop Actionscript
Table of contents | Previous document | Download BubbleTroubleLoop.as | SWF!T Homepage RCSfile: BubbleTroubleLoop.as,v Revision: 1.2 Date: 2003/02/12 18:30:58
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.
Loop script for a single animated bubble.
author Olaf Havnes
version Revision: 1.2 Date: 2003/02/12 18:30:58
since SWFIT1.0
Iterating algorithm based on the double angle formulas.
s_2 = s_0 + 2 * s * c_1;
c_2 = c_0 - 2 * s * s_1;
s_0 = s_1;
c_0 = c_1;
s_1 = s_2;
c_1 = c_2;
life ++;
if (life < incubate)
{
y -= INCUBATE_SPEED;
}
else if (life < grow)
{
y -= GROW_SPEED;
birth._visible = true;
burst._visible = false;
death._visible = false;
}
else if (life < burst)
{
y -= BURST_SPEED;
birth._visible = false;
burst._visible = true;
death._visible = false;
}
else if (life < death)
{
y -= DEATH_SPEED;
birth._visible = false;
burst._visible = false;
death._visible = true;
}
else
{
removeMovieClip ("");
}
if (reverse_dir)
{
_x = int (x + s_2);
_y = int (y + c_2 / AMPLITUDE_Y_DIVISOR);
}
else
{
_x = int (x + c_2);
_y = int (y + s_2 / AMPLITUDE_Y_DIVISOR);
}
|
|