cocos2d-x is a cross plaform port of cocos2d-iphone using C++. It supports iOS, Mac, Android, Samsung Bada, BlackBerry Tablet OS, Windows and Linux. It has built-in bindings for Lua and Javascript.

learn more… | top users | synonyms

0
votes
0answers
15 views

using eclipse instead of visual studio for cocos2d-x project

im using coco2d-x v 3.0 i made a new windows project to test it and it is working but when i try to build and run a project using this command cocos run -p win32 it is print this error it seem ...
0
votes
0answers
33 views

Libgdx vs Cocos2d-x [on hold]

What is your preferred game engine for developing mobile games today? I pick this two since it is one of the popular among open source game engine. I been reading its documentation and view all the ...
0
votes
0answers
34 views

Determine speed of sprite

I'm trying to calculate the speed of my sprites in Cocos2d but I'm having some difficulties. I'm not sure which units of time/speed cocos2d uses. My background sprite moves 2 positions to left each ...
0
votes
0answers
36 views

Cocos2d-x , setup the debug environment and remove the red marks in my eclipse

I am struggling with this issue since last week. I still can’t figure out where is the error. My code is compiling perfect if I restart the eclipse. but, when I edit the c++ file it shows red marks ...
0
votes
0answers
18 views

Trying to make a mouseJoint with Box2D on Cocos2D-X

I'm trying to obtain this result: http://appcodingeasy.com/Gideros-Mobile/Dragging-Box2d-object-in-Gideros-Mobile (there's a video - YouTube). But I'm missing something, because if I follow the code ...
0
votes
0answers
149 views

cocos2d-x-3.0rc0b Build fails [on hold]

I have created a cpp Cross platform project with cocos2d-x-3.0rc0 on windows8 , but i can't build the android project. I have the following result: C:\home\MyGame\proj.android\proj.android>python ...
1
vote
2answers
150 views

Best logic to create and drop new gems in a Match-3 game

In a simple match-3 game, with a square gems matrix creating and dropping new gems is fairly simple: when needed I generate those gems above the matrix and then I make them fall into the main matrix ...
1
vote
2answers
168 views

How do I separate testable game logic from my UI in Cocos2d-x?

I read some articles on why I should separate game logic and UI code: That makes it possible to test game logic code can be independently of the rest. However, I am having trouble implementing this in ...
0
votes
1answer
36 views

Changes to myApp.js files are reverted back to normal when the project is build - Cocos2dx

I am trying to do some changes to my myApp.js file of coco2dx project for android in eclipse but I am not able to do it. I am actually trying to change the default background image of my app. But ...
0
votes
0answers
40 views

cocos2d-html5 & cocos2d-js compatibility

Currently we are shifting towards html5 dev for a few customers and I'm wondering how compatible are the 2 javascript versions of cocos2dx (cocos2d-html5 & cocos2d-x with javascript bindings). ...
-1
votes
1answer
141 views

Tower Defense Search Enemies Efficiently

I had a problem with the build of a TD. I got a slow - non efficient search for towers find targets to shoot. PD: enemies[] got all the active & non-active enemies (death and alive) ->Im using ...
0
votes
1answer
132 views

How do you create 2D skeletal animations without extra software? [closed]

I'm working on a Cocos2d-x game and I'm developing on Windows. What I want is to make some skeletal animations, without using a tool or extra software to do so?
0
votes
1answer
77 views

translate-scroll repeated 2d texture using opengl shader

I managed to implement an infinite 2d texture scrolling using the following shader. btw I'm using cocos2d-x 2.2.1. The vertex shader: attribute vec4 a_position; attribute vec2 a_texCoord; #ifdef ...
0
votes
0answers
81 views

box2d's ApplyForce works wrong after cocos2d-x's replaceScene

i'm practicing making a breakout game, using cocos2d-x 3.x and box2d, referencing here. i create a ball in the scene's init function and apply force. when ball hits bottom wall, if i touch screen ...
1
vote
2answers
113 views

How can I list files in a folder from JavaScript in cocos2d-x?

I need to list all the files in the res folder from a JavaScript script in cocos2d-x. What would be the most efficient way to do this? To keep compatibility with Cocos2d-html5 a JavaScript-only ...
1
vote
1answer
278 views

Create tile map in Cocos2D-X by not using TMX file

I used to make a tile base game in Windows with my own tile map file, but it is a static tile map. I use an 2D array to store of my tile map. Now I want to make game in smartphone by using Cocos2D-X, ...
0
votes
0answers
142 views

Should I drawing directly on CCLayer or CCSprite?

Now I am a little confused in my cocos2d-x cpp project. I want to draw lines with user's finger touch. Following the screenshot of a CCScene: In the screen, there are two squares. I want show an ...
-1
votes
1answer
92 views

Collision function calls before colliding

My Box2D contact listener class is calling post solve and beginning the contact function before colliding? This is causing my object to bounce back before hitting the ground. What could be causing ...
0
votes
1answer
151 views

How to find collision detection side between two objects?

I am using box2D and I have two objects, one is bouncy ball and the other one is block. I'd like to find which side of the block is collided with, so I can only make the ball bounce when it hits the ...
0
votes
0answers
208 views

Design virtual resolution for 2D development in Unity

I came to Unity with Cocos2D-X experience in mind. In Cocos2D-X, I can choose a "virtual" screen resolution size to rely on the entire game during development and the game will automatically adapt to ...
0
votes
1answer
159 views

cocos2dx- set draw() method interval time

What is the default interval of draw method call in cocos2dx engine? Can we set it manually? I couldn't find much information about it online. After researching a bit I found that update() method ...
0
votes
2answers
145 views

Implementing `fling` logic without pan gesture recognizers

So I am trying to port over a simple game that I originally wrote to iphone into cocos2d-x. I've hit a minor bump however in implementing simple 'fling' logic I had in the iphone version that is ...
0
votes
0answers
311 views

Cocos2dx- Draw primitives(polygons) on Update

In my game I'm trying to draw polygons on on each step i.e. update method. I call draw() method to draw new polygon with dynamic vertices. Following is my code: void HelloWorld::draw () { ...
1
vote
0answers
296 views

Cocos2d-x CCFollow Zooming issue

Hi I am currently building a cocos2d-x game which incorporates pinch zoom using CCLayerPanZoom class which can be found here The problem is basically when using CCFollow and zooming and out, it ...
1
vote
1answer
182 views

Limiting the speed of a dragged sprite in Cocos2dx

I am trying to drag a row of sprites using ccTouchesMoved. By that I mean that there is a row of sprites (they are colored squares) lined up next to each other and if I grab one with a touch the rest ...
0
votes
0answers
74 views

cocos2dx and tweenings libs

I know cocos2dx has built-in actions like move-to, etc... to do some kind of tweening but haven't seen any way for example to add different easy ins and outs. Browsing the documentation haven't found ...
1
vote
1answer
253 views

Project location to perspective fake 3D view

I am trying to implement a perspective view in a 2D soccer game, such like Nintendo World Cup. In this case, the soccer pitch will look like a isosceles trapezoid, but not a rectangle in real. Here ...
1
vote
0answers
420 views

Parallax Scrolling Road-2D [duplicate]

I'm working on a racing game which will have a top view from the back camera. The image below displays a similar example. I am confused about how to achieve the movement of the road if parallax ...
0
votes
1answer
244 views

CCMoveBy values on update()

Hope you can help me. This is my problem: I have a scheduled update, here I track the movements of my objects (sprites), I move them with CCMoveBy, and I need to constantly update the zOrder. For ...
2
votes
1answer
573 views

Pixel Perfect Collision Detection in Cocos2dx

I am trying to port the pixel perfect collision detection in Cocos2d-x the original version was made for Cocos2D and can be found here: ...
0
votes
0answers
203 views

syncing multiple audio tracks on Android

I'm trying to create a music based game (similar to "my singing monsters). the idea is that I have a scene where I can place and remove a few different characters from the scene, each character has a ...
3
votes
1answer
299 views

How to implement throw curve with virtual height in a 2D side-view game

I am working on a 2d side-view soccer game that looks like this image: But now I stuck on how to implement parabola pass ball. I have found many questions corresponding to my problem: Calculating ...
0
votes
1answer
156 views

How to get position of CCSprite added to CCParallaxNode?

I have a CCparallaxNodeExtras that scrolls infinite (following the space game tutorial). I added as a child a CCSprite made of other CCSprite, like this: _backgroundNode = ...
0
votes
1answer
124 views

How do you align the edges of sprites?

If you have SpriteA and SpriteB. SpriteB is a child of SpriteA. Does anyone have a mechanism to come up with the left, right, top, side of a boundingbox() of SpriteA? What I'd like to do is align ...
0
votes
2answers
513 views

What is the differencen between ccTouchesEnded and ccTouchEnded

I'm learning cocos2d-x. Following the tutorial I found that ccTouchesEnded works perfectly in linux (and windows) but when I replace by ccTouchEnded the event isn't detected anymore. What are ...
0
votes
0answers
100 views

How do I find the rotation point given a touch anchor, new position and new rotation?

I've got an Cocos2d layer which anchorPoint, position and rotation (according to http://www.qcmat.com/understanding-anchorpoint-in-cocos2d/) vary when the pinch zoom gestures. Everything works fine. ...
1
vote
1answer
1k views

How to switch sprite animations in cocos2d-x?

I have a "GameCharacter" class where I have a sprite for my main character in the game, I loaded the frames and animations correctly. I can switch between animations with single touches or swiping ...
0
votes
3answers
3k views

Cocos2d-x Finding if a CCPoint is inside a sprite rect

I'm afraid that I'm missing something. This is what I've done: I've made a scene using layers (Gimp), then I've exported the layers with the image size, that way I thought would be more easy to add ...
0
votes
0answers
247 views

Apply various effects to alpha channel using cocos2dx

I have some CCSprite with images which contain shadows. Apart from the shadows and the background the images are opaque. I'd like to be able to draw some CCSprite but without the shadows when they are ...
0
votes
1answer
1k views

How to set multiple animations in cocos2d-x

I'm currently starting with cocos2d-x to build games for blackberry/android/iOS. I have the png and plist for the animations of a character created with texturepacker. I load them with ...
0
votes
1answer
155 views

How to Initilize CCPoint Array from String?

I've got string like this: {{0,168},{20,20}}, here indicates two points. I want to get them out to initialize my CCPoint. Do you guys know how to convert this?
1
vote
1answer
193 views

Is it a good idea to use box2d to control sprite movement in a 2D game?

I'm trying to use Box2D to control sprite movement.Some burning issues are these: 1.When I trying to move the sprite on a slope or a lean barrier. The sprite will move off the slope which is not what ...
2
votes
0answers
325 views

Not able to change the background of the scene in cocos2dx android

I have started Game Development using Cocos2d-x. And started with HelloWorld sample game. I am able to run this sample game. But when I try to change the Background Color, I am getting error in ...
0
votes
1answer
194 views

Cocos2d-x cross platform development

I want to make a game with my friends on iOs, Android, WP operating systems. We decided to use a cocos2d-x and develop the core of the game on C++. What will be the right way of developing so that we ...
1
vote
2answers
592 views

Coordinate and positioning problem on iOS with cocos2d-x

I'm using cocos2d-x alongside with Marmalade and running some tests and tutorials before starting an actual project with them. So far things are working reasonably well on the windows simulator, ...
0
votes
3answers
351 views

Changing the rendering resolution while maintaining the design layout

I would like to increase the FPS of my project. Currently I would like to try reducing the resolution at which the scenes are rendered. Let's say I never want to draw more than 1280*720. What ever ...
0
votes
2answers
1k views

cocos2dx - Custom Fragment Shader and CCRenderTexture

I have a CCRenderTexture that is filled with a sprite when the scene is loaded, as follows, canvas = CCRenderTexture::create(this->getContentSize().width, this->getContentSize().height); ...
0
votes
1answer
194 views

Multi Resolution graphic for ios 4 and ios 5

i have used cocos2d-x to code game for ios 4, ios 4s, ios 5 with screen size (3.5 inch and 4 inch) First, my resource are desgined for ios 4 and ios 4s with screen size : 3.5 inch. so if i want to ...
0
votes
1answer
647 views

Can't Build Cocos2Dx emscripten project

I need to port a Cocos2D-x project to Web (JS+HTML5). I'm trying to compile cocos2D-x samples using the emscripten project for cocos2d-x, and I've followed this tutorial ...
2
votes
1answer
2k views

why lua is so important ( frequently used ) in game development [duplicate]

I wrote some small games for fun myself, and never used LUA myself. but I can see people discussing lua used in games everywhere. I don't know what benefit I can get from using LUA in game ...