Giter VIP home page Giter VIP logo

cocos2d-js's Introduction

*** 2/27/2016 - This repository is no longer active. Cocos2d-JS was merged with Cocos2d-x starting at version 3.7. *** please go here

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-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.

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.

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).

Downloads

Online demos

Documentations

About Cocos2d family

  • Cocos2d-JS v3.0 uses Cocos2d-x 3.2 final as base of JSB solution
  • Cocos2d-JS v3.0 is compatible with Cocos Code IDE v1.0.0 RC2+
  • Cocos2d-JS v3.0 is compatible with Cocos Studio v1.2 - v2.0

With any problems you might have, our communities are happy to help:

How to Start a New Game

  1. Download the code from Cocos2d download site
  2. Run setup.py
  3. Run the cocos script

Example:

$ cd cocos2d-js
$ ./setup.py
$ source FILE_TO_SAVE_SYSTEM_VARIABLE

$ cocos new MyGame -l js -d /directory/to/project
$ cd /directory/to/project/MyGame

###Run the project under the game directory

  • Run Cocos2d-html5 project with a Websever:

     cocos run -p web
    
  • Compile and run project in Cocos2d-JSB :

     cocos compile -p ios|mac|android|win32|web
     cocos run -p ios|mac|android|win32|web
    

You may need to provide your Android NDK, Android SDK and ANT's paths during the setup. Note that this tool is developed with python, so you will need python (32bit) 2.7.5 or later installed on your machine (but it doesn't support Python3). Please refer to Cocos Console document.

And if you have any doubt about the usage, please use -h with any command to have some help messages.

You can also use prebuilt Xcode or Visual Studio projects which are located in Game/frameworks/runtime-src/proj.xxx

##Folder structure of new project

  • frameworks
    • cocos2d-html5 : Cocos2d-JS html5 engine source
    • js-bindings : JSB engine source (include Cocos2d-x and JSB)
    • runtime-src : IDE projects (Android, iOS, Mac OS, Win32)
  • publish : Published apps
  • runtime : Debug app files
  • tools : JS Bindings generator
  • res : Your game resource folder for images, sounds, etc
  • src : The source code folder to place your game's js files
  • main.js : The entrance of your game logic
  • index.html : The web page for hosting your game in web server

##Built-in Projects

There are two prebuilt projects in Cocos2d-JS repo:

  • Test cases, located in samples/js-tests
cd samples/js-tests
run -p ios|mac|android|win32|web
  • Game sample : Moon Warriors, located in samples/js-moonwarriors
cd samples/js-moonwarriors
run -p ios|mac|android|win32|web

And they share the same project files which are located in build folder, there are Xcode and Visual Studio projects.

##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
  • Basic menus and buttons
  • Integrated with physics engines: [Box2d][5] and [Chipmunk][6]
  • Particle system
  • Skeleton Animations: [Spine][7] 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 systems
  • 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

Notice

For JSB build, there are some restrictions :

  • [Android build] NDK version must be r10c
  • [iOS build] Xcode version must be 5.1.1 +

##Github note

If you fork our github repository or download the package from github, you will need to do some extra tasks:

  • Run git submodule update --init --recursive in the cocos2d-js root folder, to init and update submodules recursively, such as cocos2dx/plugin.
  • Run frameworks/js-bindings/cocos2d-x/download-deps.py to download external dependencies for Cocos2d-x
  • Run tools/cocos2d-console/download-bin.py to download bin files for some cocos2d-console plugins like Google Closure Compiler and JSC Compiler.

Otherwise, you will fail to compile your JSB projects.

cocos2d-js's People

Contributors

akira-cn avatar andot avatar bofeng-song avatar chuanweizhang2013 avatar cocoscodeide avatar cocosrobot avatar dingpinglv avatar duhaibo0404 avatar go3k avatar hbbalfred avatar himynameschris avatar hogarfield avatar lihe757 avatar livingyang avatar minggo avatar mutoo avatar pandamicro avatar samuele3hu2022 avatar seobyeongky avatar simondel avatar sincntx avatar smallaitt avatar stammen avatar thomas-jablonski avatar tkowalski avatar visualsj avatar wuzhiming avatar xiaofeng11 avatar xingsenma avatar zhaijialong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cocos2d-js's Issues

How to debug jstests?

I use Cocos Code IDE, import JSTests in cocos2d-js-v3.0-beta, then build mac runtime:

CpResource /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/frameworks/js-bindings/bindings/script/jsb_property_impls.js /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/mac/JSTests\ Mac.app/Contents/Resources/jsb_property_impls.js
    cd /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/frameworks/runtime-src/proj.ios_mac
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/frameworks/js-bindings/bindings/script/jsb_property_impls.js /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/mac/JSTests\ Mac.app/Contents/Resources

** BUILD FAILED **


The following build commands failed:
    CpResource /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/rtres /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/mac/JSTests\ Mac.app/Contents/Resources/rtres
(1 failure)
Runing command: compile
Building mode: debug
building
running: 'xcodebuild -project "/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/frameworks/runtime-src/proj.ios_mac/JSTests.xcodeproj" -configuration Debug -target "JSTests Mac" CONFIGURATION_BUILD_DIR=/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/mac'

Error running command, return code: 65

The 2nd time build runtime again, the error turns to:

** BUILD FAILED **


The following build commands failed:
    CpResource /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/rtres /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/mac/JSTests\ Mac.app/Contents/Resources/rtres
    CpResource /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/project.json /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/mac/JSTests\ Mac.app/Contents/Resources/project.json
(2 failures)
Runing command: compile
Building mode: debug
building
running: 'xcodebuild -project "/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/frameworks/runtime-src/proj.ios_mac/JSTests.xcodeproj" -configuration Debug -target "JSTests Mac" CONFIGURATION_BUILD_DIR=/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/js-tests/project/proj.android/runtime/mac'

Error running command, return code: 65

I can debug successfully by creating a new "hello world" project, so I copy all the JSTests files to the "Hello world" project, but build runtime error again:

Ld /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/runtime/mac/CocosJSGame\ Mac.app/Contents/MacOS/CocosJSGame\ Mac normal x86_64
    cd /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/frameworks/runtime-src/proj.ios_mac
    export MACOSX_DEPLOYMENT_TARGET=10.8
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/runtime/mac -F/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/runtime/mac -filelist /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/frameworks/runtime-src/proj.ios_mac/build/CocosJSGame.build/Debug/CocosJSGame\ Mac.build/Objects-normal/x86_64/CocosJSGame\ Mac.LinkFileList -mmacosx-version-min=10.8 -stdlib=libc++ -fobjc-link-runtime /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/runtime/mac/libjsbindings\ Mac.a -lchipmunk\ Mac -lcocos2dx\ Mac -lcocos2dx-extensions\ Mac -lCocosDenshion\ Mac -lcurl -lsqlite3 -lz -framework IOKit -framework AppKit -framework OpenGL -framework QuartzCore -framework OpenAL -framework AudioToolbox -framework AVFoundation -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/frameworks/runtime-src/proj.ios_mac/build/CocosJSGame.build/Debug/CocosJSGame\ Mac.build/Objects-normal/x86_64/CocosJSGame\ Mac_dependency_info.dat -o /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/runtime/mac/CocosJSGame\ Mac.app/Contents/MacOS/CocosJSGame\ Mac
ld: library not found for -lchipmunk Mac
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld /Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/runtime/mac/CocosJSGame\ Mac.app/Contents/MacOS/CocosJSGame\ Mac normal x86_64
(1 failure)
Runing command: compile
Building mode: debug
building
running: 'xcodebuild -project "/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/frameworks/runtime-src/proj.ios_mac/CocosJSGame.xcodeproj" -configuration Debug -target "CocosJSGame Mac" CONFIGURATION_BUILD_DIR=/Users/apple/Downloads/cocos2d-js-v3.0-beta/samples/CocosJSGame/runtime/mac'

Error running command, return code: 65

Packing App run SocketIO Failure

代码:

    var SocketIO = SocketIO || io; // 打包APP后 这句代码 以下的代码貌似跟屏蔽了一样不会执行,PC 浏览器是正常的

    var label = cc.LabelTTF.create("SocketIO", "Arial", 48);
    label.setPosition(cc.p(winsize.width / 2, winsize.height / 2));
    this.addChild(label, 10);

    var sioclient = SocketIO.connect("ws://127.0.0.1:3010", {"force new connection" : true});
    sioclient.on("connect", function() {
        label.setString("OK");
    });

机型:小米2S
引擎:Cocos2d-js 3.0 beta
环境:PC 浏览器 运行 SocketIO 正常
环境:打包APP后手机运行失效,而且 var SocketIO = SocketIO || io; 下面的代码也不会执行(貌似跟屏蔽了一样),不知道这是什么情况
注:项目配置文件 project.json 里已引入socketio模块
"modules" : ["cocos2d","extensions","socketio"],

[3.0 RC0 Bug]When setOpacity to LabelBMFont, meet a rendering bug in JSB

the following is the bug situation
s40712-113227
the result is setOpacity(0) to the LabelBMFont
----------- Language Dividing Line -----------
更新了RC0版本后,在JSB上原来一起正常的LabelBMFont,现在出现了严重的透明渲染问题,但其他Sprite, LabelTTF均正常。
图中情况出现在设置setOpacity(0)时,这时最为严重。

cocos2dx-html5 中的 touch.getLocation()得到的坐标错误

在没有设置camera位置的时候(默认为0,0点),点击最左下角,touch.getLocation()返回的坐标为0,0,是正确的场景坐标。

在场景的中camera观察点改变后,用以下设置后:
camera.setEye(0, 100, z);
camera.setCenter(0, 100, 0);

点击最左下角,touch.getLocation()返回的坐标还是为0,0,而不是正确的场景坐标(0,100),因为摄像机上移后,左下角点的在场景中应该为(0,100)。

Failed to load resource(moduleConfig.json)

I try to open index.html in Safari after cocos new hello -l js,but the whole screen is black and empty.
Which console shows:

[Error] Failed to load resource: 请求的 URL 在此服务器上找不到。 (moduleConfig.json, line 0)
file:///Users/mac/Studio/game/cocos2d-js/mygame/hello/libs/cocos2d-html5/moduleConfig.json

And then I copy cocos2d-js/frameworks/cocos2d-html5/moduleConfig.json into this directory,but the console shows:

[Error] load json [libs/cocos2d-html5/moduleConfig.json] failed : load libs/cocos2d-html5/moduleConfig.json failed!
    (匿名函数) (CCBoot.js, line 1747)
    (匿名函数) (CCBoot.js, line 555)
    onload (CCBoot.js, line 515)

BUG 键盘监听事件无法响应按键

键盘监听事件无法响应按键
测试环境:PC web
浏览器:Chrome
引擎版本:cocos2d-js 3.0 beta
cc.eventManager.addListener({
event : cc.EventListener.KEYBOARD,
onKeyPressed : function(keyCode, event){
cc.log(keyCode);
},
onKeyReleased : function(keyCode, event){
cc.log(keyCode);
}
}, this);

set chipmunk:true in project.json is not working

I try to make This guide working with cocos-2d-js v3.0

{
    "project_type": "javascript",

    "debugMode": 1,
    "showFPS": true,
    "chipmunk":true,
    "frameRate": 60,
    "id": "gameCanvas",
    "renderMode": 0,
    "engineDir": "frameworks/cocos2d-html5",

    "modules": ["cocos2d"],

    "jsList": [
        "src/resource.js",
        "src/app.js",
        "src/AnimationLayer.js",
        "src/BackgroundLayer.js",
        "src/PlayScene.js",
        "src/StatusLayer.js",
        "src/globals.js",
        "src/Coin.js",
        "src/Rock.js"
    ]
}

But when I open it in browser, showing error Uncaught ReferenceError: cp is not defined

And then I fixed it by

    "jsList": [
        "frameworks/cocos2d-html5/external/chipmunk/chipmunk.js",
        "src/resource.js",
        "src/app.js",
        ...
    ]

bug of cc.Class.extend if compile js to jsc

fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
prototype[name] = typeof prop[name] == "function" &&
            typeof _super[name] == "function" && fnTest.test(prop[name]) ?

the regexp will test whether include '_super' in custom function body, there is no problem in js mode since function auto convert to string correctly, but the body is compressed in jsc mode...

so far i use a workaround is to remove the test in jsc mode.
is there a better way to solve it?

ccs.Armature的getBoundingBox返回值不对

ccs.Armature的getBoundingBox返回值不对,只有用boundingBox()得到的才是对的,ccs.Armature也是从cc.Node派生下来的,能不能把getBoundingBox()的值调整对呢,这样可以用统一的接口来得到包围盒。

tileMap in mobile browser

This is a tileMap. In mobile browser , part of the lost at the bottom like img1. In pc browser, you can see all part like img2

My create code is like this :
var map = cc.TMXTiledMap.create("res/back.tmx");
map.setPosition(35,85);

img1
img2

Some paths are not recogniced

I've found some problems:

  1. The setup.py seems to only be able to locate User environment variables, but not System ones
  2. The standard path for Ant seems to be "ANT_HOME", however, setup.py looks for "ANT_ROOT".
  3. COCOS_CONSOLE_ROOT is not being defined properly, in my case, for example it got set to "C:\Cocos2d-JS/tools/cocos2d-console\bin" rather than "C:\Cocos2d-JS\tools\cocos2d-console\bin"
  4. The route to the console's bin folder need to be added to the "Path" System environment variable or else the command "cocos" is not recognized.

AssetsManager::createDirectory(const std::string& path) bug on windows

because windows path start like c:/ or d:/
so the following code when i==0 it will do this
CreateDirectoryA("c:/", NULL);
it will make the function return false , so the full path will not create

else

if ((GetFileAttributesA(path.c_str())) == INVALID_FILE_ATTRIBUTES)
{
    subpath = "";
    for(int i = 0 ; i < dirs.size() ; ++i)
    {
        subpath += dirs[i];
        BOOL ret = CreateDirectoryA(subpath.c_str(), NULL);
        if (!ret && ERROR_ALREADY_EXISTS != GetLastError())
        {
            return false;
        }
    }
}
return true;

endif

buggy plist loader

there was a bug in plist loader that read the plist file repeat both in jsb and cpp
to fix it is either just read in jsb or read in cpp
i have fixed in #320 to read in cpp, but @joshuastray choose another way #344
so the bug is coming again...

i have no test which way is better yet...
maybe i should remove my previous modification to fix it?

favicon.ico missing

The file "favicon.ico" is missing from the template's "res" folder, and so a project created with the script is also missing it.
(and it's expected, the console shows a 404 error message)

ANT_ROOT not defined

I cannot compile for android. It says the following:

Runing command: compile
Building mode: debug
ANT_ROOT not defined. Please define it in your environment

my export command outputs the following:
declare -x ANT_ROOT="/usr/bin/ant"

How can I solve this issue?

Movie play feature

Hi, from what I understand html5 provides some nice methods to play video in browsers. It would be great if we could get this integrated into cocos2d-js.

The game crashed on my coolpad 8060 phone

cocos new MyGame -l js
cd MyGame/
cocos compile -p android

Installed the apk to my phone, run it and got errors below, the C++ or lua version is ok but js broken down...

01-02 14:55:50.757: I/DEBUG(12307): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-02 14:55:50.765: I/DEBUG(12307): Build fingerprint: 'marvell/dkb/dkb:2.3.7/GWK74/2.3.009.P1.120905.8060:user/release-keys'
01-02 14:55:50.765: I/DEBUG(12307): pid: 13101, tid: 13101 >>> org.cocos2dx.hellojavascript <<<
01-02 14:55:50.765: I/DEBUG(12307): signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 82e6e28c
01-02 14:55:50.765: I/DEBUG(12307): r0 00000000 r1 00000000 r2 00000000 r3 836f69d0
01-02 14:55:50.765: I/DEBUG(12307): r4 836f61d0 r5 0000004c r6 00000004 r7 00000000
01-02 14:55:50.765: I/DEBUG(12307): r8 80317f40 r9 0000ced8 10 448c8bf8 fp 4561a238
01-02 14:55:50.765: I/DEBUG(12307): ip ffffffff sp bedff2c0 lr b00037f5 pc 82e6e28c cpsr 60000010
01-02 14:55:50.984: I/DEBUG(12307): #00 pc 82e6e28c /mnt/asec/org.cocos2dx.hellojavascript-1/lib/libcocos2djs.so
01-02 14:55:50.984: I/DEBUG(12307): #1 lr b00037f5 /system/bin/linker
01-02 14:55:50.984: I/DEBUG(12307): code around pc:
01-02 14:55:50.984: I/DEBUG(12307): 82e6e26c e5832004 e2833008 e1530000 1afffff7
01-02 14:55:50.984: I/DEBUG(12307): 82e6e27c e59f40a8 e3a00000 e1a02000 e08f4004
01-02 14:55:50.984: I/DEBUG(12307): 82e6e28c e6ef1072 e201703f e1a03321 e2033001
01-02 14:55:50.984: I/DEBUG(12307): 82e6e29c e1a013c1 e1a06083 e1866003 e2235001
01-02 14:55:50.984: I/DEBUG(12307): 82e6e2ac e1836086 e1a01f81 e1836086 e1815f05
01-02 14:55:50.984: I/DEBUG(12307): code around lr:
01-02 14:55:50.984: I/DEBUG(12307): b00037d4 2a002601 1e48d003 18e40083 00b64276
01-02 14:55:50.984: I/DEBUG(12307): b00037e4 e0061c0d 19a46823 32031e5a 4798d800
01-02 14:55:50.984: I/DEBUG(12307): b00037f4 2d003d01 bd70dcf6 1c03b510 1c0433e8
01-02 14:55:50.984: I/DEBUG(12307): b0003804 28006818 3304d004 22016819 ffdef7ff
01-02 14:55:50.984: I/DEBUG(12307): b0003814 682334f4 d0002b00 bd104798 4c05b510
01-02 14:55:50.984: I/DEBUG(12307): stack:
01-02 14:55:50.984: I/DEBUG(12307): bedff280 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff284 00000003
01-02 14:55:50.984: I/DEBUG(12307): bedff288 00000001
01-02 14:55:50.984: I/DEBUG(12307): bedff28c 0000ced8 [heap]
01-02 14:55:50.984: I/DEBUG(12307): bedff290 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff294 82e64118 /mnt/asec/org.cocos2dx.hellojavascript-1/lib/libcocos2djs.so
01-02 14:55:50.984: I/DEBUG(12307): bedff298 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff29c 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff2a0 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff2a4 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff2a8 00000001
01-02 14:55:50.984: I/DEBUG(12307): bedff2ac 8366a764 /mnt/asec/org.cocos2dx.hellojavascript-1/lib/libcocos2djs.so
01-02 14:55:50.984: I/DEBUG(12307): bedff2b0 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff2b4 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff2b8 df002777
01-02 14:55:50.984: I/DEBUG(12307): bedff2bc e3a070ad
01-02 14:55:50.984: I/DEBUG(12307): bedff2c0 8366a774 /mnt/asec/org.cocos2dx.hellojavascript-1/lib/libcocos2djs.so
01-02 14:55:50.984: I/DEBUG(12307): bedff2c4 0000004c
01-02 14:55:50.984: I/DEBUG(12307): bedff2c8 00000004
01-02 14:55:50.984: I/DEBUG(12307): bedff2cc 00000000
01-02 14:55:50.984: I/DEBUG(12307): bedff2d0 b000e1cc
01-02 14:55:50.984: I/DEBUG(12307): bedff2d4 b000e1c8
01-02 14:55:50.984: I/DEBUG(12307): bedff2d8 0000273f
01-02 14:55:50.984: I/DEBUG(12307): bedff2dc b00038a7 /system/bin/linker
01-02 14:55:50.984: I/DEBUG(12307): bedff2e0 01705000
01-02 14:55:50.984: I/DEBUG(12307): bedff2e4 afd00000 /system/lib/libc.so
01-02 14:55:50.984: I/DEBUG(12307): bedff2e8 00000025
01-02 14:55:50.984: I/DEBUG(12307): bedff2ec b000e0e8
01-02 14:55:50.984: I/DEBUG(12307): bedff2f0 836ad078 /mnt/asec/org.cocos2dx.hellojavascript-1/lib/libcocos2djs.so
01-02 14:55:50.984: I/DEBUG(12307): bedff2f4 b000e0e8
01-02 14:55:50.984: I/DEBUG(12307): bedff2f8 0000273f
01-02 14:55:50.984: I/DEBUG(12307): bedff2fc b0004fa3 /system/bin/linker
01-02 14:55:50.984: I/DEBUG(12307): bedff300 00000025
01-02 14:55:50.992: I/DEBUG(12307): bedff304 b000e174
01-02 14:55:50.992: I/DEBUG(12307): bedff308 b000e0e8
01-02 14:55:50.992: I/DEBUG(12307): bedff30c 00000008
01-02 14:55:50.992: I/DEBUG(12307): bedff310 00000000
01-02 14:55:50.992: I/DEBUG(12307): bedff314 80348749 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff318 bedff33c
01-02 14:55:50.992: I/DEBUG(12307): bedff31c b000e0f0
01-02 14:55:50.992: I/DEBUG(12307): bedff320 00000000
01-02 14:55:50.992: I/DEBUG(12307): bedff324 b000e0e8
01-02 14:55:50.992: I/DEBUG(12307): bedff328 005752b0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff32c 005752dd [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff330 40514f60 /dev/ashmem/dalvik-heap (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff334 b0004fed /system/bin/linker
01-02 14:55:50.992: I/DEBUG(12307): bedff338 b000e0e8
01-02 14:55:50.992: I/DEBUG(12307): bedff33c b0004b05 /system/bin/linker
01-02 14:55:50.992: I/DEBUG(12307): bedff340 005752b0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff344 bedff3a4
01-02 14:55:50.992: I/DEBUG(12307): bedff348 005752b0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff34c 40514f60 /dev/ashmem/dalvik-heap (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff350 005752b0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff354 bedff3a4
01-02 14:55:50.992: I/DEBUG(12307): bedff358 005752b0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff35c b00059d5 /system/bin/linker
01-02 14:55:50.992: I/DEBUG(12307): bedff360 0000ced8 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff364 8034e13b /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff368 40514f60 /dev/ashmem/dalvik-heap (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff36c 000007ff
01-02 14:55:50.992: I/DEBUG(12307): bedff370 00000001
01-02 14:55:50.992: I/DEBUG(12307): bedff374 005752b0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff378 803a45c0 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff37c 00000001
01-02 14:55:50.992: I/DEBUG(12307): bedff380 0000006e
01-02 14:55:50.992: I/DEBUG(12307): bedff384 8035449f /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff388 00000000
01-02 14:55:50.992: I/DEBUG(12307): bedff38c 40514f60 /dev/ashmem/dalvik-heap (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff390 005752b0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff394 bedff408
01-02 14:55:50.992: I/DEBUG(12307): bedff398 40086bb8 /dev/ashmem/dalvik-heap (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff39c 80366147 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff3a0 448c8b38
01-02 14:55:50.992: I/DEBUG(12307): bedff3a4 00000000
01-02 14:55:50.992: I/DEBUG(12307): bedff3a8 44e9a902 /system/framework/core.odex
01-02 14:55:50.992: I/DEBUG(12307): bedff3ac 448c8c28
01-02 14:55:50.992: I/DEBUG(12307): bedff3b0 bedff400
01-02 14:55:50.992: I/DEBUG(12307): bedff3b4 8031cfd8 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff3b8 80322050 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff3bc bedff400
01-02 14:55:50.992: I/DEBUG(12307): bedff3c0 00000001
01-02 14:55:50.992: I/DEBUG(12307): bedff3c4 00000000
01-02 14:55:50.992: I/DEBUG(12307): bedff3c8 0000cee0 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff3cc 0004deb8 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff3d0 bedff6b0
01-02 14:55:50.992: I/DEBUG(12307): bedff3d4 803a9d08
01-02 14:55:50.992: I/DEBUG(12307): bedff3d8 4561a238 /system/framework/framework.odex
01-02 14:55:50.992: I/DEBUG(12307): bedff3dc 803220e0 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff3e0 bedff400
01-02 14:55:50.992: I/DEBUG(12307): bedff3e4 0000ced8 [heap]
01-02 14:55:50.992: I/DEBUG(12307): bedff3e8 80322050 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff3ec 4496c504 /dev/ashmem/dalvik-LinearAlloc (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff3f0 fffffec4
01-02 14:55:50.992: I/DEBUG(12307): bedff3f4 80320fd4 /system/lib/libdvm.so
01-02 14:55:50.992: I/DEBUG(12307): bedff3f8 00000000
01-02 14:55:50.992: I/DEBUG(12307): bedff3fc bedff39c
01-02 14:55:50.992: I/DEBUG(12307): bedff400 4561a238 /system/framework/framework.odex
01-02 14:55:50.992: I/DEBUG(12307): bedff404 448c8ebc
01-02 14:55:50.992: I/DEBUG(12307): bedff408 40523668 /dev/ashmem/dalvik-heap (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff40c 00000007
01-02 14:55:50.992: I/DEBUG(12307): bedff410 449c907c /dev/ashmem/dalvik-LinearAlloc (deleted)
01-02 14:55:50.992: I/DEBUG(12307): bedff414 00017058 [heap]
01-02 14:55:51.007: I/DEBUG(12307): bedff418 0000ced8 [heap]
01-02 14:55:51.007: I/DEBUG(12307): bedff41c bedff3b8
01-02 14:55:51.007: I/DEBUG(12307): bedff420 448c6300
01-02 14:55:51.007: I/DEBUG(12307): bedff424 0000cee0 [heap]
01-02 14:55:51.007: I/DEBUG(12307): bedff428 44038f70
01-02 14:55:51.007: I/DEBUG(12307): bedff42c 803aa036
01-02 14:55:51.007: I/DEBUG(12307): bedff430 803aa078
01-02 14:55:51.007: I/DEBUG(12307): bedff434 00000000
01-02 14:55:51.007: I/DEBUG(12307): bedff438 00000000
01-02 14:55:51.007: I/DEBUG(12307): bedff43c 00000000
01-02 14:55:51.007: I/DEBUG(12307): bedff440 00000000
01-02 14:55:51.937: I/ActivityManager(1306): Process org.cocos2dx.hellojavascript (pid 13101) has died.
01-02 14:55:51.945: D/Zygote(1059): Process 13101 terminated by signal (4)

chipmunk physics works but sprite with animation doesn't move

I got this code from the example parkour(I'm using cocos2d-js v3.0alpha2, Cocos Code IDE):

   this.sprite = cc.Sprite.create("#zombie1.png");
    this.sprite.attr({x:120, y:120});
    this.sprite.scale = 0.5;
    this.sprite.runAction(this.runningAction);
    this.spriteSheet.addChild(this.sprite);

    //1. create PhysicsSprite with a sprite frame name
    this.sprite = cc.PhysicsSprite.createWithSpriteFrameName("zombie1.png");
    var contentSize = this.sprite.getContentSize();
    // 2. init the runner physic body
    this.body = new cp.Body(1, cp.momentForBox(1, contentSize.width, contentSize.height));
    //3. set the position of the runner
    this.body.p = cc.p(g_runnerStartX, g_groundHight + contentSize.height / 2);
    //4. apply impulse to the body
    this.body.applyImpulse(cp.v(150, 0), cp.v(0, 0));//run speed
    //5. add the created body to space
    this.space.addBody(this.body);
    //6. create the shape for the body
    this.shape = new cp.BoxShape(this.body, contentSize.width - 14, contentSize.height);
    //7. add shape to space
    this.space.addShape(this.shape);
    //8. set body to the physic sprite
    this.sprite.setBody(this.body);

Here chipmunk physics works (debugnode shows it) but sprite with animation doesn't move..

Warning: Open Wifi for debuging...

I get this dialog box when I try to debug my game on an android console. It's connected with ethernet.

Would it be possible to get rid of this test?

Update libwebsockets

The currently used version of libwebsockets (v 1.23) is 8 months old and contains some huge bugs. I.e. headers are parsed with incorrect case sensitivity which breaks compatibility with various web servers.

It would be great if it could be updated to latest version (master branch of https://github.com/warmcat/libwebsockets).

Are there any instructions on how to update the source and compile it for cocos2d-x?

cocos2d-js and phonegap

I think, cocos2d-js and phonegap does same thing. The difference is cocos2d-js use OpenGLES and phonegap use native webview.

Consider, how about let cocos2d-js works like phonegap? Every module is plugin. and add it use command cocos plugin add XXX

Bug in CocoStudioTest

step 1 : run EffectComponentTest in SceneTest;
step 2 : goto TestAsynchronousLoading in ArmatureTest;

you will get a "debug assertion failed" msg.

事件吞噬

现使用CCTableView来实现一个列表
每个TableViewCell 内现有两个按钮需相应。

无论是使用cocosStutio生成的Widget或者ControlButton等初始_needSwallow属性都为true
都会将touch事件吞噬导致tableView接收不到touch信息

现将源码内CCScrollView内的addEventListenerWithSceneGraphPriority修改为addEventListenerWithFixedPriority能临时解决

想请问是否已有接口可以实现同样效果我没有找到,或我对于现在的事件分发理解错误。

3.0beta use script cocos new project webdebug failed

I use script cocos new to create a new project, and open with webstorm, then debug. However it outputs errors below!

Uncaught Missing file: CCDirectorWebGL.js
cc.assert CCDebugger.js:296
(anonymous function) CCDirector.js:905
Cocos2d-html5-v3.0 beta
Uncaught TypeError: Property '_createStatsLabel' of object # is not a function
cc.EGLView.cc.Class.extend.setDesignResolutionSize CCEGLView.js:464
cc.game.onStart main.js:2
(anonymous function) CCBoot.js:1470
(anonymous function) CCBoot.js:1612
(anonymous function) CCBoot.js:419
cc.async._counterFunc CCBoot.js:127
(anonymous function) CCBoot.js:429
Uncaught TypeError: Object # has no method '_clear'
cc.Director.cc.Class.extend.drawScene CCDirector.js:211
cc.DisplayLinkDirector.cc.Director.extend.mainLoop CCDirector.js:766
callback CCBoot.js:1438

cocos2d-js 3.0 rc0 messed up the touch events of pageview

It didn't respond the touch events of layout of pageview, but it works fine on beta. And the mouse events work fine on both rc0 and beta.

It could capture the touch events of the left or right side which out range of pageview.

Errors on Firefox 27.0.1

I've tried both the included server (with command "cocos run -p web") and another webserver I have installed, and with both I get the following errors in Firefox:

TypeError: console.assert is undefined CCBoot.js:917
TypeError: cc.game is undefined

The same source requested from both servers works fine in Chrome.

Flowing text

I was wondering if there's also any support for flowing text (ex. text coming out per letter in a flowing manner over time - the speed adjustable in terms of ms/letter).

If there isn't, this would be great to have; especially for RPG style games.

And congrats on the RC0 release!

cocos2d-js 3.0 crashed on ios 5

I tested on ipad 1 with ios 5.1.1 and iphone 4s with ios 5.0.1. It appeared the cocos2d logo of full screen, and then it crashed. Xcode could not capture any error with All Exceptions. But it works fine on ios 6 and above.
It compiled with Xcode 5.1.1 on OS X 10.9.1 both cocos2d-js 3.0 rc0 and beta.

build android package failed.

error output:

e:\temp\test9\MyJSGame>d:\cocos2d-js\tools\cocos2d-console\bin\cocos compile -p android

Runing command: compile
Building mode: debug
NDK build mode: debug
building native
The Selected NDK toolchain version was 4.8 !
running: 'd:\android-ndk-r9d\ndk-build -C e:\temp\test9\MyJSGame\frameworks\runtime-src\proj.android
-j1 NDK_MODULE_PATH=e:\temp\test9\MyJSGame\frameworks\runtime-src\proj.android../../js-bindings;e:\temp\test9\MyJSGame\frameworks\runtime-src\proj.android../../js-bindings/cocos2d-x;e:\temp\test9\MyJSGame\frameworks\runtime-src\proj.android../../js-bindings/cocos2d-x/cocos;e:\temp\test9\MyJSGame\frameworks\runtime-src\proj.android../../js-bindings/cocos2d-x/external NDK_DEBUG=1'

Android NDK: e:\temp\test9\MyJSGame\frameworks\runtime-src\proj.android../../js-bindings/bindings/Android.mk: Cannot find module with tag '.' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
make.exe: Entering directory e:/temp/test9/MyJSGame/frameworks/runtime-src/proj.android' e:\temp\test9\MyJSGame\frameworks\runtime-src\proj.android\../../js-bindings/bindings/Android.mk:46: *** Android NDK: Aborting. . Stop. make.exe: Leaving directorye:/temp/test9/MyJSGame/frameworks/runtime-src/proj.android'
Error running command, return code: 2

cocos2d-js and Linux

This is really a noob suggestion, but ...

I think wiki is missing information how to compile to Linux and Win.

.cocos-project.json not defined in Moonwarriors and tests

When attepting to run the source I get a "Can't find config file .cocos-project.json" error.

There exists a "project.json" file in the "samples/js-moonwarriors" folder, but renaming it to ".cocos-project.json" then causes the followin error when attempting the run command:

C:\Cocos2d-JS\samples\js-moonwarriors>cocos run -p web

C:\Cocos2d-JS\samples\js-moonwarriors>python C:\Cocos2d-JS\tools\cocos2d-console
\bin\/cocos.py run -p web
Runing command: compile
Traceback (most recent call last):
  File "C:\Cocos2d-JS\tools\cocos2d-console\bin\/cocos.py", line 578, in <module
>
    run_plugin(command, argv, plugins)
  File "C:\Cocos2d-JS\tools\cocos2d-console\bin\/cocos.py", line 558, in run_plu
gin
    dependencies_objects[dep_name] = run_plugin(dep_name, argv, plugins)
  File "C:\Cocos2d-JS\tools\cocos2d-console\bin\/cocos.py", line 560, in run_plu
gin
    plugin.run(argv, dependencies_objects)
  File "C:\Cocos2d-JS\tools\cocos2d-console\bin\..\plugins\project_compile\proje
ct_compile.py", line 635, in run
    self.parse_args(argv)
  File "C:\Cocos2d-JS\tools\cocos2d-console\bin\cocos.py", line 195, in parse_ar
gs
    self._project = Project(os.path.abspath(os.getcwd()))
  File "C:\Cocos2d-JS\tools\cocos2d-console\bin\cocos.py", line 229, in __init__

    self._parse_project_json(project_dir)
  File "C:\Cocos2d-JS\tools\cocos2d-console\bin\cocos.py", line 241, in _parse_p
roject_json
    lang = project_info[Project.KEY_PROJ_TYPE]
KeyError: 'project_type'

If I try to run this by hosting it in a server, I get the following errors in Chrome:
Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:50152/frameworks/cocos2d-html5/CCBoot.js
Uncaught ReferenceError: cc is not defined

All of the above also applies to the contents of "js-tests".

How to outline labels

I was wondering how I would go about enabling labels to have a black outline of their text.

Not compatible with OS X 10.7

In the wiki, it says that the runtime requirement is OS X 10.7. Creating a new project and building it works, but it doesn't run on Lion (it complains that the OS X version is too old).

If I change the project's deployment target to 10.7, it compiles, but crashes on start with the following error:

Dyld Error Message:
  Library not loaded: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
  Referenced from: /Users/USER/*/Muse.app/Contents/MacOS/Muse Mac
  Reason: Incompatible library version: Muse Mac requires version 64.0.0 or later, but ApplicationServices provides version 1.0.0

大尺寸全屏缩小后触摸坐标错误

cocos2d-js-v3.0-beta
cc.view.setDesignResolutionSize(640, 960, cc.ResolutionPolicy.EXACT_FIT);
设置的640x960,在android普通分辨率(480x854)的屏幕上触摸坐标错误,onTouchesMoved事件中第一次获取getDelta的值错误

ccui.RichText中文支持

可参照Bata版本UIRichTextTest,RichElementText内容改为中文后,换行失常,期初以为是richText大小问题,将size调整大之后完全不显示

popScene can't see ccs

sceneA is include a ccs. when popScene SceneA can't see the ccs again.

sceneA create code :
ctor:function(){
this._super();
var node = ccs.sceneReader.createNodeWithSceneFile(res.scene.city);
this.addChild(node);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.