前面遊戲的各個部分都完善了,遊戲共一百關,後面還有使用粒子系統的部分,給遊戲添加特效;寫得有點粗糙ui
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 }