⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 抖动.sqe

📁 flash文档文档文档文档文档文档文档文档文档文档文档文档
💻 SQE
字号:
========== Description Part Begin ==========
name = "抖动";
description = "实例在一定区域内抖动。";
version = "1.00";
bin = "RandomJumping.bin";
========== Description Part End ==========


========== Parameter Part Begin ==========
$nCharacterCount(EDIT,INT,1,1 10000,"实例总数","指的是使用了该特效的实例的总数。这个值是由影片里所选中的实例数决定的,在这里不能设置。");
$nFrameCount(EDIT,INT,3,3 3,"总帧数","指的是含有动作代码的总帧数。特效播放的总帧数可能比动作代码的帧数多。");
$nRandom(EDIT,INT,8,1 30,"区域","设定允许实例移动的区域。");
$nSpeed(EDIT,INT,2,1 100,"透明度变化速度","实例的透明度变化速度。");


========== Parameter Part End ==========


========== Function Part Begin ==========
nFrameCount = 10;
nCharacterCount = 4;


nRandom = 5;
nSpeed = 2;

nIndex = 0;
X = new Array(nFrameCount );
Y = new Array(nFrameCount );
for(n = 1 ; n <= nFrameCount;n++)
{
	X[n -1] = this["c" + n]._x;
	Y[n -1] = this["c" + n]._y;
}


	for (i = 1; i <= nCharacterCount; i++)
	{
		
		this["c" + i]._alpha = 100;
	}

function again()
{
	gotoAndPlay(2);
}
	
	function init()
	{
		for (i = 1; i <= nCharacterCount; i++)	
		{
			this["c" + i]._alpha = 100;
		}
	}
	

function restoration()
{
	for(n = 1 ; n < nFrameCount;n++)
	{
		this["c" + n]._x = X[n - 1];
		this["c" + n ]._y= Y[n - 1] ;
	}
}


function fun()
{
	if(nIndex > nFrameCount)
		restoration();
	if(c1._alpha  < 0)
	{
		init();
		return ;
		
	}
	nSize += 5;
	for (i = 1; i <= nCharacterCount; i++)
	{
		if(random(2))
		{
			this["c" + i]._y +=  random(nRandom);
		}
		else
		{
			this["c" + i]._y -=  random(nRandom);
		}
		if(random(2))
		{
			this["c" + i]._x += random(nRandom);	
		}
		else
		{
			this["c" + i]._x -= random(nRandom);
		}
		this["c" + i]._alpha -= nSpeed;
	}
	nIndex++;
	
}

========== 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 + -