七彩舞动精灵

 

关键代码部分:

// Action script…

// [Action in Frame 1]
Stage.scaleMode = “noScale”;

// [Action in Frame 218]
stop ();
p = new Array();
count = 0;
p[count] = {x: _xmouse, y: _ymouse, w: 0, col: 0};
++count;
rand = Math.random;
sin = Math.sin;
r = 255;
g = 127;
b = 0;
w = 0;
ri = 2.000000E-002;
gi = 1.500000E-002;
bi = 2.500000E-002;
this.onEnterFrame = function ()
{
vx = _xmouse - oldx + rand() * 2 - 1;
vy = _ymouse - oldy + rand() * 2 - 1;
oldx = _xmouse;
oldy = _ymouse;
p[count] = {x: _xmouse, y: _ymouse, vx: vx * 5.000000E-001, vy: vy * 5.000000E-001, w: sin(w = w + 2.000000E-001) * 5 + 5, col: sin(r = r + ri) * 128 + 127 << 16 | sin(g = g + gi) * 128 + 127 << 8 | sin(b = b + bi) * 128 + 127};
++count;
clear();
moveTo(_xmouse, _ymouse);
for (var i in p)
{
lineStyle(p[i].w, p[i].col);
p[i].x = p[i].x + p[i].vx;
p[i].y = p[i].y + p[i].vy;
if (p[i].y > 380)
{
p[i].y = 380;
p[i].vy = p[i].vy * -5.000000E-001;
p[i].vx = p[i].vx * 9.500000E-001;
} // end if
if (i)
{
curveTo(p[i].x, p[i].y, (Number(p[i].x) + Number(p[i - 1].x)) / 2, (Number(p[i].y) + Number(p[i - 1].y)) / 2);
} // end if
if (p.length > 50)
{
p.splice(0, 1);
–count;
} // end if
} // end of for…in
};

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值