Cocos2d JS 之消灭星星(十二) 游戏帮助

前面游戏的各个部分都完善了,游戏共一百关,后面还有使用粒子系统的部分,给游戏添加特效;写得有点粗糙

 1 /*
 2  * @游戏帮助说明
 3  */
 4 var GameHelpLayout = ccui.Layout.extend(
 5 {
 6     ctor:function()
 7     {
 8         this._super();
 9         this.zinit();
10         this.setBackButton();
11     },
12     //还回按钮
13     setBackButton:function()
14     {
15         var backButton = new myButton(res.returnBtn);
16         backButton.x = 480 - backButton.width - 10;
17         backButton.y = 10;
18         this.addChild(backButton, 1);
19         backButton.addTouchEventListener(this.backButtonFunc, this);
20     },
21     //
22     backButtonFunc:function(target,state)
23     {
24         if(state == ccui.Widget.TOUCH_ENDED)
25         {
26             var newGameScene = GameInitializeScene.createScene();
27             cc.director.runScene(cc.TransitionFade.create(1, newGameScene));
28         }
29     },
30     zinit:function()
31     {
32         this.setSize(cc.size(480, 800));
33         var bg = new myImage(res.helpbg);
34         this.addChild(bg, 0);
35     }
36 });
37 
38 GameHelpLayout.createScene = function()
39 {
40     var layout = new GameHelpLayout();
41     var scene = cc.Scene.create();
42     scene.addChild(layout);
43     return scene;
44 }

 

转载于:https://www.cnblogs.com/zfsSuperDream/p/4108543.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值