• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Developer_方方
博客园    首页    新随笔    联系   管理    订阅  订阅

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 }

 

posted @ 2014-11-19 16:24  Developer_方方  阅读(971)  评论(5)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3