惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
aimingoo的专栏
aimingoo的专栏
I
InfoQ
IT之家
IT之家
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
爱范儿
爱范儿
Microsoft Azure Blog
Microsoft Azure Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
博客园_首页
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler

博客园 - SeanLin

Cocos2d-html5资源预加载列表自动扫描脚本 JSDoc参考注释模板 [转]Git常用操作命令 Cocos2d-html5 HelloWorld模板和引擎使用简介 Javascript API Document生成工具JSDoc HTML5游戏开发涉及到的安全问题 Javascript开发的HTML5游戏的知识产权保护 CCTextureCache的多线程加载原理和使用 引擎demo任务 引擎开发数据记录 游戏引擎消息循环机制 渲染部分 几个需要思考的问题 【转】使用Jasob混淆javascript代码 【转】html5游戏开发引擎大全 【转】V8 Javascript 引擎设计理念 android 字体位置信息 【转】蓝牙协议中HCI层的研究与开发 【转】蓝牙协议的命令和事件
引擎初始化过程
SeanLin · 2012-03-08 · via 博客园 - SeanLin

1.加载js

CC.loadjs = function(filename)

{

    //add the file to the que

    var script = CC.$new('script');

    script.src = CC.CCDir + filename;

    script.order = CC.loadQue.length;

    CC.loadQue.push(script);

    script.onload = function()

    {

        //file have finished loading,

        //if there is more file to load, we should put the next file on the head

        if(this.order+1 < CC.loadQue.length)

        {

            CC.$('head').appendChild(CC.loadQue[this.order+1]);

        }

        else

        {

            //we are ready to run the game

            CC.AppController.didFinishLaunchingWithOptions();

        }

    };

    if(script.order === 0)//if the first file to load, then we put it on the head

    {

        CC.$('head').appendChild(script);

    }

};

2. 加载成功之后,调用CC.AppController.didFinishLaunchingWithOptions();

3. 开始加载AppDelegate,初始化运行Director,canvas。设置帧率和引擎参数。

4. 创建出具体的scene,并加入Director。

5. 开始主循环的loop。 

先记录这么多,再补充更关键实现方法。