麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 辦公 > Flash > 正文

Flash AS實現(xiàn)的蝌蚪擺尾動畫的教程

2020-07-17 13:25:08
字體:
供稿:網(wǎng)友
本例介紹使用Flash的AS編寫蝌蚪擺尾動畫效果,希望朋友們喜歡~~
 

 
場景里代碼

復(fù)制代碼
代碼如下:

  Object.environment = this;
  Math.prototype.degrees = function (r)
  {
  return (r * 180 / 3.141593E+000);
  };
  maxtents = 3;
  this.onEnterFrame = function ()
  {
  if (!random(30) && tents < maxtents)
  {
  var nombre = "tent" + String(depth++);
  var neo = this.attachMovie("tentacle", nombre, depth);
  neo._x = random(600);
  neo._y = 370;
  neo.theta = 270;
  ++tents;
  } // end if
  };
  stop ()

#initclip 1

復(fù)制代碼
代碼如下:

  function TentacleClass()
  {
  this.numNodes = 27;
  this.head = 2 + random(4);
  this.girth = 8 + random(12);
  this.speedCoefficient = 9.000000E-002 + random(10) / 50;
  this.friction = 9.000000E-001 + random(10) / 100;
  this.muscleRange = 20 + random(50);
  this.muscleFreq = 1.000000E-001 + random(100) / 250;
  this.generateNodes();
  this.onEnterFrame = this.move;
  } // End of the function
  TentacleClass.prototype = new MovieClip();
  TentacleClass.prototype.generateNodes = function ()
  {
  this.node = new Array();
  var n = 0;
  while (n < this.numNodes)
  {
 
  var point = {x: 0, y: 0};
  this.node.push(point);
  ++n;
  } // end while
  };
  TentacleClass.prototype.move = function ()
  {
  this.tv = this.tv + 5.000000E-001 * (Math.random() - Math.random());
  this.theta = this.theta + this.tv;
  this.tv = this.tv * this.friction;
  this.node[0].x = this.head * Math.cos(1.745329E-002 * this.theta);
  this.node[0].y = this.head * Math.sin(1.745329E-002 * this.theta);
  this.count = this.count + this.muscleFreq;
  this.thetaMuscle = this.muscleRange * Math.sin(this.count);
  this.node[1].x = -this.head * Math.cos(1.745329E-002 * (this.theta + this.thetaMuscle));
  this.node[1].y = -this.head * Math.sin(1.745329E-002 * (this.theta + this.thetaMuscle));
  var i = 2;
  while (i < this.numNodes)
  {
  var dx = this.node.x - this.node[i - 2].x;
  var dy = this.node.y - this.node[i - 2].y;
  var d = Math.sqrt(dx * dx + dy * dy);
  this.node.x = this.node[i - 1].x + dx * this.girth / d;
  this.node.y = this.node[i - 1].y + dy * this.girth / d;
  if (i == 2)
  {
  this._x = this._x - dx * this.speedCoefficient;
  this._y = this._y - dy * this.speedCoefficient;
  if (this._x + this._width < 0    this._x - this._width > 600    this._y + this._height < 0    this._y - this._height > 400)
  {
  --Object.environment.tents;
  this.removeMovieClip();
  } // end if
  } // end if
  ++i;
  } // end while
  this.clear();
  this.moveTo(this.node[1].x, this.node[1].y);
  var i = 2;
  while (i < this.numNodes)
  {
  this.lineStyle(int(this.numNodes - i) * (this.numNodes - i) / 20, 16777215, 100);
  this.lineTo(this.node.x, this.node.y);
  ++i;
  } // end while
  };
  Object.registerClass("tentacle", TentacleClass);
  #endinitclip
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 国产精品99久久久久久董美香 | 女教师~淫辱の动漫在线 | 久久国产精品久久久久久久久久 | 欧美视频国产精品 | 激情综合婷婷久久 | 韩国十九禁高潮床戏在线观看 | av电影免费看 | 在线2区| 国产午夜精品理论片a级探花 | 色女生影院 | 欧美一级免费在线观看 | 最新久久免费视频 | 久久精品网 | 国产午夜免费不卡精品理论片 | 久久精品国产99国产精品亚洲 | 日韩一级免费毛片 | 毛片视频在线免费观看 | 欧美成人福利 | 久久新网址 | 成人福利视频网站 | 亚洲精品午夜电影 | 91福利免费观看 | 黄色网欧美 | 毛片免费观看日本中文 | 悠悠成人资源亚洲一区二区 | 毛片大全免费 | 日本a级免费 | 国产精品91在线 | 免费中文视频 | 黄网站免费入口 | 欧美一级做一级爱a做片性 久久久资源网 | 久色porn| 国产一级毛片国语版 | 一区二区三区黄色 | 嗯~啊~弄嗯~啊h高潮视频 | 免费黄色大片网站 | 亚洲国产成人久久一区www妖精 | 黄色免费在线网址 | 国产精品1区2区在线观看 | 特级a欧美做爰片毛片 | 日韩区在线 |