Cocos2d JS 之消滅星星(五) 遊戲主情境

來源:互聯網
上載者:User

標籤:style   blog   io   color   os   ar   for   sp   div   

 1 /* 2  * 遊戲主情境 3  */ 4 var GameMainScene = ccui.Layout.extend( 5 { 6     ctor:function() 7     { 8         this._super(); 9         this.zinit();10         this.setTopInfor();11         this.addStarLayout();12     },13     //遊戲主情境頂部顯示資訊14     setTopInfor:function()15     {16         var gameTopInfo = new GameTopInformation();17         gameTopInfo.y = this.size.height - gameTopInfo.height;18         this.addChild(gameTopInfo, 1);19     },20     //將星星層添加到主情境21     addStarLayout:function()22     {23         var starLayout = GameStarLayout.createLayout();24         this.addChild(starLayout, 1);25     },26     //初始化27     zinit:function()28     {29         //設定布局大小30         this.size = cc.size(480, 800);31         this.setSize(this.size);32         //執行個體化背景圖片33         var backGround = new myImage(res.mainbacktop);34         backGround.y = this.size.height - backGround.height;35         this.addChild(backGround, 0);36         var backGround1 = new myImage(res.mainbackbottom);37         this.addChild(backGround1, 0);38     }39 });40 41 42 GameMainScene.createScene = function()43 {44     var gameLayout = new GameMainScene();45     var scene = cc.Scene.create();46     scene.addChild(gameLayout);47     return scene;48 };

 

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.