正在阅读:flash实例:超强的粒子特效flash实例:超强的粒子特效

2007-05-22 09:17 出处: 作者:yinggoing 责任编辑:chenzhenjia

  相关链接:flash8打造瀑布动画效果教程     Flash8制作动态放大镜画面效果    Flash打造“时空穿梭”特效


 

  超强的粒子特效,效果非常好,在此和大家分享:


效果预览

 

  #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


下载源文件请点击

 

  粒子特效相关文章:

  After effects 6.5实例教程-粒子特效  3DS MAX4粒子特效--喷发的烟雾

关注我们

最新资讯离线随时看 聊天吐槽赢奖品