飞机游戏
来源:互联网 发布:炒股最好的软件 编辑:程序博客网 时间:2024/05/01 05:41
先给飞机定一个初始坐标
this._inAnpng.setPosition(cc.winSize.width>>1,(cc.winSize.height>>1)-200);
在给飞机一个点击移动事件
var that = this;var listener = cc.EventListener.create({ event: cc.EventListener.TOUCH_ONE_BY_ONE, swallowTouches: true, onTouchBegan: function (touch, event) { return true; }, onTouchMoved: function (touch, event) { var target=that.飞机; var po = touch.getDelta(); target.x += po.x ; target.y += po.y ; }, onTouchEnded:function(touch, event){ }
设置上飞机的子弹坐标 随战机一起移动 并且使子弹发射事件添加计时器
//子弹移动var Sp = new cc.Sprite("res/png_3.png");Sp.setPosition(this._inAnpng.x, this._inAnpng.y + 80)this.addChild(Sp);var moveTo = cc.moveBy(2, cc.p(0, cc.winSize.height << 1));Sp.runAction(cc.sequence(moveTo, cc.callFunc(this.removeBullet, this)));
removeBullet:function(target){ target.removeFromParent(true)}
this.schedule(this._dan, 1 / 5, cc.repeatForever, 1);
0 0
- 飞机游戏
- 飞机游戏
- 飞机游戏
- 飞机游戏
- 《飞机游戏》
- 飞机游戏
- 飞机游戏
- 飞机游戏
- Java版飞机游戏
- 开发飞机游戏总结
- C#打飞机游戏
- 飞机游戏策划
- 小型安卓打飞机游戏
- 小型安卓打飞机游戏
- 飞机游戏2
- 飞机游戏的制作
- 飞机游戏初步
- 飞机游戏(1)
- [转+整理]关于linux静态库和动态库的分析
- springmvc(基础五) Spring3 mvc 获取请求参数的几种方式
- Android-JSON数据解析
- mac os (EI Capitian) 安装python遇到问题
- AIX给rootvg加镜像/创建非rootvg卷组(主要步骤缩略版)
- 飞机游戏
- 我所理解的word2vec
- 《Java小游戏实现》:坦克大战(续三)
- iOS 字符串转JSON去除特殊字符的方法(去除表情)
- 如何控制项目需求变更管理
- 【60】Spring总结之基础架构(1)
- 设计模式——装饰者模式
- PayPal-支付接口下载地址
- Metasploit利用远程桌面协议RDP拒绝访问漏洞(MS12-020)