📄 四面八方.sqe
字号:
========== Description Part Begin ==========
name = "四面八方";
description = "每个实例变幻成四个物体,分别向左上,右上,左下,右下四个方向飞去,直至消失。";
version = "1.00";
bin = "AllDirections.bin";
========== Description Part End ==========
========== Parameter Part Begin ==========
$nCharacterCount(EDIT,INT,1,1 10000,"实例总数","指的是使用了该特效的实例的总数。这个值是由影片里所选中的实例数决定的,在这里不能设置。");
$nFrameCount(EDIT,INT,3,3 3,"总帧数","指的是含有动作代码的总帧数。特效播放的总帧数可能比动作代码的帧数多。");
$nInterval(EDIT,INT,5,1 10000,"时间间隔","前一个实例和后一个实例开始移动的时间间隔。");
$bDirection(LIST,INT,1,"左":1 "右":0,"方向","控制实例从左到右,或从右到左开始变幻。");
========== Parameter Part End ==========
========== Function Part Begin ==========
nCharacterCount = 8;
nFrameCount = 8;
nInterval = 10;
bDirection = true;
nSizeMax = 500;
nSizeMin = 100;
nRSizeMax = 200;
nRSizeMin = 100;
nCentreArrayX = new Array(nCharacterCount);
nCentreArrayY = new Array(nCharacterCount);
nRotateArray = new Array(nCharacterCount);
nRadiusArray = new Array(nCharacterCount);
nIsRun = new Array(nCharacterCount);
for(i = 1;i <= nCharacterCount ;i++)
{
nCentreArrayX[i] = this["c" + i]._x;
nCentreArrayY[i] = this["c" + i]._y;
for(n = 1;n <= 4;n++)
{
nIndex = nCharacterCount + ((i -1) * 4 + n);
this["c" + i].duplicateMovieClip("c"+nIndex, nIndex);
this["c" + nIndex]._visible = false;
}
}
for (i = 1; i <= nCharacterCount ; i++)
{
this["c" + i]._alpha = 100;
this["c" + i]._rotation = 0;
this["c" + i]._visible = true;
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)
{
//????ê±??μ?,ò??ˉ4??ó°×ó
this["c" + i]._visible = false;
MoveGhost(i);
}
nIsRun[i -1] --;
}
if(bDirection)
{
if(this["c" + (nCharacterCount * 5)]._alpha < -20)
gotoAndPlay(1);
}
else
{
if(this["c" + (nCharacterCount + 1)]._alpha < -20)
gotoAndPlay(1);
}
}
function MoveGhost(i)
{
for(n = 1;n <= 4;n++)
{
nIndex = nCharacterCount + ((i - 1) * 4 + n);
this["c" + nIndex]._visible = true;
rotation = 45;
switch(n)
{
case 1:
rotation = 45;
break;
case 2:
rotation = 135;
break;
case 3:
rotation = 225;
break;
case 4:
rotation = 315;
break;
}
this["c" + nIndex]._x = Math.cos(Math.PI / 180 * rotation) * nRadiusArray[nIndex] + nCentreArrayX[i];
this["c" + nIndex]._y = Math.sin(Math.PI / 180 * rotation) * nRadiusArray[nIndex] + nCentreArrayY[i];
this["c" + nIndex]._alpha -= 5;
this["c" + nIndex]._rotation += 5;
this["c" + nIndex]._xscale -= 10;
nRadiusArray[nIndex] += 5;
}
}
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 + -