Flash AS2教程:跳跃的小球
作者 佚名技术
来源 服务器技术
浏览
发布时间 2012-07-07
效果显示: 详细代码: //AS2.0QQ:31559783 2009.11.28 MovieClip.prototype.zl = function() { this.vg = 0.7; this.vy = 0; this.vx = 0; this.an = true; this.onEnterFrame = function() { this.vy += this.vg; this._y += this.vy; this._x += this.vx; if (this._x>550) { this._x = 0; } if (this._x<0) { this._x = 550; } if (this._y>300) { this._y = 300; this.vy *= -0.5; this.vx *= 0.9; } if (this._y == 300 && this.an == true) { ss(this._x, this._y); } if (this._y == 300 && Math.abs(this.vy) >> 0 == 0) { this.an = false; } }; this.tt = function() { this.vg = 0.7; this.vy = 0; this.vx -= (this._x-_root._xmouse)/30; this.dy = this._y-_root._ymouse; this.vy -= this.dy/10; }; }; function ss(X, Y) { var sj = (Math.random()*10+20) >> 0; for (var i = 0; i<sj; i++) { var mc = this.createEmptyMovieClip("huaxian_mc", this.getNextHighestDepth()); mc._x = X; mc._y = Y; mc.lineStyle(Math.random()*3, 0, 100); mc.moveTo(0, 0); mc.lineTo(1, 0); mc.vx = random(20)-10; mc.vy = random(20)-10; mc.onEnterFrame = function() { this._x += this.vx; this._y += this.vy; this.vy += 0.8; this._alpha -= 2; if (this._alpha<1 || this._y>=300) { this.removeMovieClip(); } }; } } mc.zl(); mc1.zl(); this.onMouseDown = function() { if (mc.an == false) { ss(mc._x, mc._y); mc.an = true; mc.tt(); } }; this.onEnterFrame = function() { if (random(50) == 0) { if (mc1.an == false) { ss(mc1._x, mc1._y); mc1.an = true; mc1.tt(); } } }; 源文件下载: 跳跃的小球.rar 关键词: |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于Flash AS2教程:跳跃的小球的所有评论