📄 螺旋旋转2.sqe
字号:
========== Description Part Begin ==========
name = "螺旋旋转2";
description = "实例分为两组进行螺旋似的旋转。";
version = "1.00";
bin = "InvisiblePipe2.bin";
========== Description Part End ==========
========== Parameter Part Begin ==========
$nCharacterCount(EDIT,INT,1,1 10000,"实例总数","指的是使用了该特效的实例的总数。这个值是由影片里所选中的实例数决定的,在这里不能设置。");
$nFrameCount(EDIT,INT,3,3 3,"总帧数","指的是含有动作代码的总帧数。特效播放的总帧数可能比动作代码的帧数多。");
$nScaleSpeed(EDIT,INT,10,1 100,"缩放速度","实例的缩放速度。");
$nSpeed(EDIT,INT,10,1 100,"移动速度","实例的移动速度。");
$nRadius(EDIT,INT,70,1 10000,"半径","实例运动路径的半径。");
$nInterval(EDIT,INT,3,1 1000,"时间间隔","前一个实例和后一个实例开始变化时间间隔。");
$bDirection(LIST,INT,1,"左":1 "右":0,"方向","控制实例从左到右,或从右到左开始变幻。");
========== Parameter Part End ==========
========== Function Part Begin ==========
nCharacterCount = 8;
nFrameCount = 30;
nInterval = 2;
nSpeed = 10;
nRadius = 70;
nScaleSpeed = 10;
bDirection = 1;
nIsRun = new Array(nCharacterCount );
nYArray = new Array(nCharacterCount);
nOldPosYArray = new Array(nCharacterCount);
nRotationArray = new Array(nCharacterCount);
nRotation2Array = new Array(nCharacterCount);
for (i = 1; i <= nCharacterCount ; i++)
{
this["c" + i]._alpha = 100;
this["c" + i]._visible = true;
nYArray[i -1] = this["c" + i]._y;
nOldPosYArray[i - 1] = this["c" + i]._y;
nRotationArray[i - 1] = 0;
nRotation2Array[i - 1] = 0;
this["c" + i].duplicateMovieClip("cc" + i, i);
}
for (i = 1; i <= nCharacterCount + 1; i++)
{
if(bDirection)
{
if(i == 1)
nIsRun[0] = 0;
else
{
nIsRun[i - 1] = nIsRun[i - 2];
nIsRun[i - 1] += nInterval;
}
}
else
{
if(i == 1)
nIsRun[nCharacterCount -1] = 0;
else
{
nIsRun[nCharacterCount - i] = nIsRun[nCharacterCount - (i -1) ];
nIsRun[nCharacterCount - i] += nInterval ;
}
}
}
function fun()
{
for (i = 1;i <= nCharacterCount; i++)
{
if(nIsRun[i - 1] < 0)
{
this["c" + i]._y = nOldPosYArray[i - 1] + Math.sin(Math.PI / 180 * nRotationArray[i - 1]) * nRadius;
this["cc" + i]._y = nOldPosYArray[i - 1] + Math.sin(Math.PI / 180 * nRotation2Array[i - 1]) * nRadius;
if(nRotationArray[i -1] < 180)
{
if(this["c" + i]._xscale > 0 || this["c" + i]._yscale > 0)
{
this["c" + i]._xscale -= nScaleSpeed;
this["c" + i]._yscale -= nScaleSpeed;
this["cc" + i]._xscale -= nScaleSpeed;
this["cc" + i]._yscale -= nScaleSpeed;
if(this["c" + i]._xscale < 0)
{
this["c" + i]._xscale = 0;
this["c" + i]._yscale = 0;
}
}
}
else
{
if(this["c" + i]._xscale < 100 || this["c" + i]._yscale < 100)
{
this["c" + i]._xscale += nScaleSpeed;
this["c" + i]._yscale += nScaleSpeed
this["cc" + i]._xscale += nScaleSpeed;
this["cc" + i]._yscale += nScaleSpeed
if(this["c" + i]._xscale < 0)
{
this["c" + i]._xscale = 100;
this["c" + i]._yscale = 100;
}
}
}
nRotationArray[i - 1] += nSpeed;
nRotation2Array[i - 1] -= nSpeed;
if(nRotationArray[i -1] > 360)
nRotationArray[i -1] = nRotationArray[i -1] %360;
if(nRotationArray[i -1] < 0)
nRotationArray[i -1] = 360;
}
nIsRun[i -1] = nIsRun[i -1] - 1;
}
}
function again()
{
gotoAndPlay(2);
}
========== Function Part End ==========
========== Frame Part Begin ==========
$frame(fun,1,-1,"fun");
$frame(fun,2,-1,"fun");
$frame(again,3,-1,"again");
========== Frame Part End ==========
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -