this.removeMovieClip(); enemy.removeMovieClip(); fired--; place_enemy(); } }; } } function place_enemy() { enemy_placed = attachMovie("enemy", "enemy", _root.getNextHighestDepth(), {_x:0, _y:350}); enemy_placed.yspeed = 0; enemy_placed.onEnterFrame = function() { this.yspeed += gravity/10; this._x++; while (_root.ground.hitTest(this._x+this._width/2, this._y+this._height, true)) { this._y--; this.yspeed = 0; } if (!_root.ground.hitTest(this._x+this._width/2, this._y+this._height+1, true)) { this._y += this.yspeed; } else { this.yspeed = 0; } if (this._x>500) { this.removeMovieClip(); place_enemy(); } }; }
最终简单游戏:
上一篇:入门:Flash制作图片爆炸效果动画
下一篇:Flash制作好看的影片指导进度条
|