javascript代码实例教程-Cocos2d-JS全貌

发布时间:2019-01-22 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了javascript代码实例教程-Cocos2d-JS全貌脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

Cocos2d-JS is Cocos2d-x engine's JavaScript version that includes Cocos2d-html5 and Cocos2d-x JavaScript Bindings. IT equips your game with cross-browser and cross-platform abilities, accompanied by full Cocos2d-x features and simplified JavaScript friendly APIs.

Cocos2d-htML5和Cocos2d-x JavaScript捆绑在一起组成的Cocos2d-JS是基于Cocos2d-x引擎的JavaScript版本。通过全面的Cocos2d-x特性和简洁优雅的javascript友好的应用程序接口,该框架可以让你的游戏拥有跨浏览器和平台的能力。


Cocos2d-JS reinvented workflows for all platforms in v3.0, it PRovides a consistent development experience for whichever platform you want to distribute to, no matter web and native. "Code once, run everywhere" is incredibly easy and natural in Cocos2d-JS. With one single JavaScript code base, you can run your game on all web browsers and native platforms including Mac OS, Windows, iOS and AndROId. This will bring your game great opportunities in almost all channels of distribution. On the other hand, if you are only interested in casual games on the web, you can embed directly in your web page the Cocos2d-JS Lite Version which is extremely easy to use and light as a feather.

从3.0版本开始,Cocos2d-JS为所有平台打造了了一种全新的工作流,它为任何一个你想分发的平台包括网络和本地提供了一个一致的开发模式。“一次编码,多处运行”在Cocos2d-JS这里显得非常容易和顺理成章。通过简单的JS基石,你开发的游戏可以很容易运行各系统,比如PC端的Mac, windows,移动端的IOS和Android的浏览器和本地平台。在几乎所有的渠道分发能给你游戏带来巨大的机会。另外,如果你仅仅是感兴趣于web端的游戏开发,你可以直接下载和引用精简版的(Lite Version)Cocos2d-JS版本在你的web页面中,这种方式是相当简单和轻量级的。

Furthermore, JavaScript friendly APIs make your game development exPErience a breeze - easy to code, test and distribute. In the meantime, Cocos2d-JS v3.0 is super powerful along with all these cool new features: Editors Support, Assets Manager, Object Pool, JS to Objective-C/JAVA reflection, etc.

此外,JS人性化的API能让你在写代码,测试,发布开发环节上非常轻松,同时,通过编辑器支持,资源管理器,对象池以及JS和OC/JAVA的映射关系等新酷的特性让Cocos2d-JS显得异常强大。


Workflows

  • Cross platforms developers can use Cocos Console to create projects, boost their development with web version engine and deploy games onto all native platforms and all browsers with Cocos Console.

  • Casual web game developers can download the Lite Version and start to develop just like using other web frameworks (e.g. jQuery).


工作流

跨平台者开发可通过Cocos 控制台,可建立项目,并使用web 版本引擎在开发中,同时部署游戏在本地平台和浏览器上面。


web游戏开发者可以像使用别的web框架一样(比如jq)下载精简版本的Cocos-Js开发。


Download and API reference(下载和API引用)

  • Cocos2d-JS github repository
  • Cocos2d-JS Full Version Download
  • Cocos2d-JS Lite Version
  • Online API reference
  • Downloadable API reference
  • Online test cases

    Main features(主要特征)

    • Support All modern browsers and native platforms
    • 支持现代浏览器和本地平台
    • Scene management (workflow)
    • 场景控制器
    • Transitions between scenes
    • 场景切换
    • sprites and Sprite Sheets
    • 精灵
    • Effects: Lens, Ripple, Waves, Liquid, etc.
    • 特效
    • Actions (behaviours):
    • 动作
      • Trasformation Actions: Move, Rotate, Scale, Fade, Tint, etc.
      • Composable actions: Sequence, Spawn, Repeat, reverse
      • Ease Actions: Exp, Sin, Cubic, Elastic, etc.
      • Misc actions: CallFunc, OrbitCamera, Follow, Tween
      • Assets manager (hot update)
      • 资源管理
      • Basic menus and buttons
      • 基本菜单和按钮
      • Integrated with physics engines: Chipmunk and Box2d
      • 相互协调的物理引擎
      • Particle System
      • 颗粒系统
      • Skeleton Animations: Spine and Armature support
      • Fonts:
        • Fast font rendering using Fixed and VARiable width fonts
        • Support for .ttf fonts
        • Tile Map support: Orthogonal, Isometric and Hexagonal
        • Parallax scrolling
        • Motion Streak
        • Render To Texture
        • Touch/Accelerometer on mobile devices
        • Touch/Mouse/Keyboard on desktop
        • Sound Engine support (CocosDenshion library) based on OpenAL or WebAudio on web
        • Integrated Slow motion/Fast forward
        • Fast and comPressed textures: pvR compressed and uncompressed textures, ETC1 compressed textures, and more
        • Resolution Independence
        • Modularized engine for customization
        • Open Source Commercial Friendly: Compatible with open and closed source projects
        • OpenGL ES 2.0 (mobile) / OpenGL 2.1 (desktop) based
        • Full WebGL support and auto canvas fallback

          Documents

          • Highlighted release note of Cocos2d-JS v3.1
          • ChangeLOG of Cocos2d-JS v3.1
          • Upgrade guide to Cocos2d-JS v3.1
          • Startup

            • Lite Version workflow
            • Why use Cocos2d-html5 for Game Development
            • Resolution policy Design for Cocos2d-JS
            • History release notes
            • New features and API changes in version 3.x:

              • New workflow with cocos console
              • Assets manager
              • New event manager
              • New property API
              • Game creation
              • Construction and inheritance
              • Simplified action APIs
              • Objects Pool
              • Bake Layer
              • Reflection From Javascript to JAVA
              • Reflection from Javascript to Objective-C
              • Cocos2d-html5 modulization
              • Pure configuration file
              • Basic data refactoration
              • Singleton objects refactoration
              • Loading resource with cc.loader
              • System information in cc.sys
              • Path management with cc.path
              • Asynchronised process with cc.async
              • Modification to cc.SAXParser
              • Modification to cc.spriteFrameCache
              • About cc.FileUtils
              • About cc.log
              • Other change from v2.2.2 to v3.0
              • FaceBook support for Cocos2d-JS

                • Cocos2d-x with Facebook
                • Facebook API Reference for Cocos2d-JS
                • Facebook integration instruction for Cocos2d-JS on Android
                • Facebook integration instruction for Cocos2d-JS on iOS
                • Facebook integration instruction for Cocos2d-JS on Web
                • How to integrate with Facebook - sample app
                • Advanced topics

                  • How to compile Cocos2d-JS project in Eclipse
                  • How to use extensions in JSB(Chinese version)
                  • How to use Plugin-x on Android
                  • Plugin-x Architecture
                  • How to write your own Plugin for Android
                  • Use iOS IAP Plugin
                  • Tutorials