Cocos2d JS 之消滅星星(十二) 遊戲協助

來源:互聯網
上載者:User

標籤:style   blog   io   ar   color   os   使用   sp   on   

前面遊戲的各個部分都完善了,遊戲共一百關,後面還有使用粒子系統的部分,給遊戲添加特效;寫得有點粗糙

 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 }

 

Cocos2d JS 之消滅星星(十二) 遊戲協助

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.