Flash AS打造超強粒子視覺沖擊特效_Flash教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:由淺入深學習Flash制作賽車游戲教程賽車游戲我們總是碰到!今天給大家簡單講解一下。先測試效果:點擊這里下載源文件首先新建立一個賽車影片剪輯,由6個圖層組成一個基本的賽車。放到舞臺上的
超強的粒子特效,效果非常好,和大家分享:#initclip 1
function PoolClass()
{
this.stick = {x: 300, y: 169};
this.onEnterFrame = this.dragStick;
} // End of the function
PoolClass.prototype = new MovieClip();
PoolClass.prototype.dragStick = function ()
{
if (this.stick.x < 0)
{
this.stick.vx = this.stick.vx 4 * Math.random();
}
else if (this.stick.x > 600)
{
this.stick.vx = this.stick.vx - 4 * Math.random();
}
else
{
this.stick.vx = this.stick.vx (Math.random() - Math.random()) * 4;
} // end else if
if (this.stick.y < 0)
{
this.stick.vy = this.stick.vy 4 * Math.random();
}
else if (this.stick.y > 337)
{
this.stick.vy = this.stick.vy - 4 * Math.random();
}
else
{
this.stick.vy = this.stick.vy (Math.random() - Math.random()) * 4;
} // end else if
this.stick.x = this.stick.x this.stick.vx;
this.stick.y = this.stick.y this.stick.vy;
this.stick.vx = this.stick.vx * 8.000000E-001;
this.stick.vy = this.stick.vy * 8.000000E-001;
this.createNode(random(600), random(337), this.stick.x, this.stick.y, 7 random(13));
};
PoolClass.prototype.createRandomNode = function ()
{
var x = random(600);
var y = random(337);
var dx = this._xmouse;
var dy = this._ymouse;
var ds = 10 random(20);
this.createNode(x, y, dx, dy, ds);
};
PoolClass.prototype.createNode = function (x, y, dx, dy, ds)
{
var nombre = "nd" String(this.depth );
var neo = this.attachMovie("node", nombre, this.depth);
neo._x = x;
neo._y = y;
neo.dx = dx;
neo.dy = dy;
neo.body._xscale = ds;
neo.body._yscale = ds;
};
Object.registerClass("pool", PoolClass);
#endinitclip源文件下載:
![](http://p1.mb5u.com/jc/rar.gif)
分享:Flash8實現動態星空的通用方法你想做星空嗎?只需要把本教程的代碼復制就可以了!先看下效果:制作方法:首先修改文檔屬性:黑色背景、幀頻30fps新建立一個影片剪輯。在影片剪輯元件中繪制
相關Flash教程:
- 相關鏈接:
- 教程說明:
Flash教程-Flash AS打造超強粒子視覺沖擊特效
。