今天看到到一个小游戏,就将它分析了一下...(原文地址:http://www.gotoandplay.it/_articles/2003/10/shoot.php)
我把主要功能做了下,你可以下载程序研究研究!
准备工作:在舞台上放做一些影片剪辑!如图示
![影片剪辑的设置]()
好丑,暂且容忍下,技术为先吧!
ball上面的代码是:
onClipEvent (load) {
dirRight = 1;//将来子弹的飞行方向
speed = 5;//运行速度
d = 0;//第一个子弹的影片的深度...
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
dirRight = 1;
this._xscale = 70;
this._x += speed;
} else if (Key.isDown(Key.LEFT)) {
dirRight = 0;
this._xscale = -70;
this._x -= speed;
}//基本的运动控制,不懂的可以看看我的上一篇...<运动的控制>
if (Key.isDown(Key.SPACE)) {
//trace(Key.isDown(Key.SPACE))
//按下空格键
//a是为了按键不放将不
我把主要功能做了下,你可以下载程序研究研究!
准备工作:在舞台上放做一些影片剪辑!如图示
好丑,暂且容忍下,技术为先吧!
ball上面的代码是:
onClipEvent (load) {
dirRight = 1;//将来子弹的飞行方向
speed = 5;//运行速度
d = 0;//第一个子弹的影片的深度...
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
dirRight = 1;
this._xscale = 70;
this._x += speed;
} else if (Key.isDown(Key.LEFT)) {
dirRight = 0;
this._xscale = -70;
this._x -= speed;
}//基本的运动控制,不懂的可以看看我的上一篇...<运动的控制>
if (Key.isDown(Key.SPACE)) {
//trace(Key.isDown(Key.SPACE))
//按下空格键
//a是为了按键不放将不