FAQ Database Discussion Community


cocos2dx 3.3 animation implementation

c++,cocos2d-x,cocos2d-x-3.0,cocos2d-android,cocos2d-js
I am new in cocos2dx development.I almost learn all basic level of cocos2dx (version 3.3) in android using cpp language. I showing that there are lots of update over cocos2dx.org. In android I am currently developing the tetris game using cocos2dx version 3.3, I want to know what is the...

cc.ScrolView undefined in cocos2d-js

cocos2d-js
I tried to use ScrollView, TableView from cocos2d-js extensions and I noticed that it can't be seen! I also tried to create a class from that example but i need to use from native class!...

Create Dynamic Body using cocos 2d js and Chipmunk

javascript,cocos2d-x,game-physics,chipmunk,cocos2d-js
I am fairly new to cocos 2d and chipmunk. So far i have managed to create a static object and add collision handler to it. But i want to create a dynamic.``this.space = space; this.sprite = new cc.PhysicsSprite("#rock.png"); var body = new cp.StaticBody(); body.setPos(pos); this.sprite.setBody(body); this.shape = new cp.BoxShape(body, this.sprite.getContentSize().width,...

Progress Timer Cocos JS v3

cocos2d-js
I'm newbie in cocos-js. I want to make a health bar in cocos JS and try this code. And i choose to use Progress Timer. But when i use this code, it just show the bar, no running action. What's wrong ? var healthBar = cc.ProgressTimer.create(cc.Sprite.create("health_bar1.png")); healthBar.setType(cc.PROGRESS_TIMER_TYPE_BAR); healthBar.setBarChangeRate(cc.p(1,0)); healthBar.setMidpoint(cc.p(0,0)); this.addChild(healthBar,...

How to host an cocos2d-js web only game?

cocos2d-js
I'm very confused. Before I run an simple webonly cocos2d-js example, I was under the impression it generates the html5 + js files so I can host it everywhere or either run offline. But it is not the case, to run my example locally I have to start an cocos...

cc.textureCache.addImage blocking UI

cocos2d-x,cocos2d-x-3.0,cocos2d-js
I want to cache lot of textures in a running scene without blocking it, theoretically cc.textureCache.addImage do caching async if you call it the three arguments. This is not happening. Code: rainOfArrows: { _animFrames:[], loaded: function(){ console.log('>>>>>>>>>>>>>>LOAD!') }, load: function(){ /* Load all animation arrow sprites in memory & generate...

how can Cocos2d-JS read txt and update the file

javascript,cocos2d-js
I am working on a game that allows users to define a "dictionary" of question/answer pairs. Then, users can import the "dictionary" to the Game Scene and practice with the questions inside the "dictionary". The question is how can I do this with Cocos2d-JS? Or, I should use LocalStorage API?...

xml.Unmarshal error: expected element type but have

xml,go,unmarshalling,cocos2d-js
I try to unmarshal a XML file using xml.Unmarshal of "encoding/xml" package. The XML file starts like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>frames</key> <dict> <key>0</key> <dict> <key>frame</key> <string>{{0, 0}, {81, 145}}</string> <key>offset</key> <string>{0, 0}</string>...

Read data saved with CCUserDefault

javascript,local-storage,cocos2d-x,cocos2d-js
I’m converting my game from cocos2d-x 2.2.3 to cocos2d-js 3.2, but the players already have saved progress using the old CCUserDefaults. Now that I have to use localStorage in cocos2d-js, how can I read the old data that was saved using CCUserDefaults? I don’t want players to lose their progress...

how to port cocos2d-js to android and iphone(ipad) in cocos code ide

android,ios,cocos2d-js
I am new cocos2d developer. I am studying cocos2d-js using cocos code Ide in windows. My programming language for cocos2d-js is javascript. Cocos code Ide provides good editing and testing enviroment to develop cocos2d-js. but I can't generate from the project in cocos code Ide to the release products...