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

12
votes
5answers
920 views

tunnel effect cocos2d

I am looking to create a similar tunnel effect in COCOS2D (iOS). Could anyone suggest any pointers? ref Video 1 ref Video 2 Till now I have tried with several ring shape sprites with decreasing ...
8
votes
3answers
10k views

How to play animations in Cocos2d-x?

I'm new to Cocos2d-x and looking for a good way/tutorial on how to play animations in Cocos2d-x.
6
votes
1answer
572 views

Puzzle game: clipping of non-convex polygons on the figures

I have an original figure in the SVG file. I need to break it randomly on parts, an example of which is specified below: I have an idea, to use for partitioning Voronoi diagram (Fortune's algorithm). ...
4
votes
2answers
1k views

How to achieve smooth movement with a fixed timestep

Previously in the update method of my game I was using a variable time step which provided very smooth movement of a player sprite except when the frame rate would drop, even slightly. At that point I ...
4
votes
1answer
1k views

Isometric Tile maps in Cocos2d-x

Is there an specific isometric tile map handler in cocos2d-x? I can't find any.
4
votes
1answer
725 views

Lua or C++ in Cococ2d-x

I am going to use Cocos2d-x to make a game for Android and ios, but my question is, do I use the Lua integration or only c++, I see Lua useful here because the compilation thing. Or do I use only Lua ...
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 ...
3
votes
2answers
3k views

How to setup Cocos2D-X (Android) under Mac OS X?

Hi I've made a small game for iPhone that I also want to run on Android but I'm having problems setting up Cocos2D-X for Android. I've downloaded and installed Android SDK and NDK (under my ...
3
votes
2answers
6k views

Create an infinite scroll using CCParallaxNode in Cocos2D-X

I'm trying to create an infinite scroll using two images in a CCParallaxNode, making one move to the end of the scroll when it gets off the screen. I have tried several implementations but none has ...
3
votes
1answer
3k views

Sprite Animation using cocos2dx 2.0.2

I am trying to implement sprite animation using coco2dx. I have tried several demos, but all of them are same. While I tried, getting violation error in my code. ...
3
votes
1answer
1k views

Callback a function when a label is touched in cocos2d-x?

How do I callback a function when label is touched in cocos2d-x?
3
votes
2answers
2k views

How to use facebook sdk on a cocos2dx-project

I'm doing a game cocos2d-x, when user gets a high score, I want them to touch on the Facebook icon and share the high score on their Facebook account timeline. tutorials on facebook.developer.com ...
3
votes
1answer
554 views

Getting the height of Keyboard on Android

Hi I need to know the height of my keyboard so I can move up some textfield I have in my app. I'm using cocos2D-X but the app don't recognize the keyboardWillShow method. Thanks
3
votes
0answers
1k views

Deep Cloning C++ class that inherits CCNode in Cocos2dx [closed]

I'm stuck with something in Cocos2dx ... When i copy my class that inherits CCNode, i get a shallow copy of my class but the base type seem to still point to the original node address. We dont seem ...
2
votes
2answers
936 views

Implementing a sine using a bezier curve

I'm developing a 2D game using Cocos2d-x. Is possible to use CCBezierTo to parameterize a sine function?
2
votes
4answers
2k views

Different iPhone screen resolutions and game graphics

We are developing a 2D game for iPhone using cocos2d-x. The artists are drawing the raster graphic for a resoluion of 640x960. For older iPhone devices, those that have a resolution of 320x480, should ...
2
votes
1answer
240 views

Handle Multiple Scene

For my game, now I adopt the strategy to create multiple scene. For this I have to ask two question please provide your view for my and other members for improvement. I have created single ...
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 ...
2
votes
1answer
511 views

Spriting Animation Method

http://www.kickstarter.com/projects/539087245/spriter At 3:00 they discuss that there is a method used to separate the parts of character into individual sprites and move them saving production time ...
2
votes
1answer
3k views

Problem playing music and sound effects in Cocos2d-x

I'm new to Cocos2d-x and working on a mac. I'm trying to play music in my demo project but I'm unable to include "SimpleAudioEngine.h" in the default HelloWorld Project. I tried adding CocosDenshion ...
2
votes
2answers
642 views

Importing a windows project into android using cocos2d-x

What I am trying to do today is to import a full project to Android, but no tutorials are available for that that I have seen. My approach was to create a new android project, copy all the classes and ...
2
votes
1answer
560 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: ...
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 ...
2
votes
0answers
291 views

Can I use a shader with 2 different textures in Cocos2D (x)?

We are evaluating a variety of different graphic engines for use in our game and we want to be able to use 2 different textures for many of our sprite maps. One sprite map would be the standard RGBA ...
1
vote
2answers
167 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 ...
1
vote
2answers
149 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
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
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 ...
1
vote
2answers
588 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, ...
1
vote
1answer
431 views

Why doesn't MoveBy work in this example?

I'd like to run an action on a sprite using the MoveBy action. After lots of attempts, I can't achieve the goal... I have issues with the MoveBy in 2 different projects, so maybe I'm missing something ...
1
vote
2answers
2k views

Problem using ccTouchesEnded/ccTouchesBegan to move sprite in cocos2d-x?

I'm using ccTouchesBegan/ccTouchesEnded to move sprite from one point to another but I'm having problem, if i give two or more consecutive inputs one by one while sprite is moving(runAction is being ...
1
vote
2answers
112 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
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 ...
1
vote
1answer
239 views

Debug Render In Cocos2d Android

I want to implement debug render for cocos2d android.So I can view how bodies are created. Right now I use gdx.jar file for box2d and load that jar file following way. static { ...
1
vote
1answer
2k views

cocos2d-x v2.1 CCSpeed, CCRepeatForever, and CCAnimation jerky at high speed

I worked to port Tim Roadley's cocos2d-iphone example from (Box2D Driven Cocos2D Animation) to cocos2d-x to learn cocos2d-x for a project. It is all relatively simple to do, but I am suffering from ...
1
vote
3answers
1k views

CCUserDefault, iOS/Android and game updates

My game uses cocos2d-x and will be published on iOS platform first, later on Android. I save a lot of things with CCUserDefault (scores, which level was completed, number of coins taken, etc...). But ...
1
vote
2answers
379 views

How to swallow touches on CCMenu while sliding?

I'm creating a sliding menu for my game something like angry birds level selection but I'm having problem with buttons. If I accidentally touch any of the buttons while swiping the level starts to ...
1
vote
1answer
2k views

Android Cocos2DX using C++ in Eclipse Helios Windows XP

I have used Eclipse Helios 3.6.1 for Java development. I wanted to start C++ development in the same IDE so I installed Autotools Support For CDT, C/C++ Development Tools, C/C++ Library API ...
1
vote
1answer
1k views

Simple way to post score from my game to Facebook and Twitter?

What's the best and simple way to post score from my game to Facebook and Twitter with store link in cocos2d-x?
1
vote
1answer
335 views

New way of integrating Openfeint in Cocos2d-x 0.12.0

I am trying to implement OpenFeint for Android in my cocos2d-x project. My approach so far has been creating a button that calls a static java method in class Bridge using jnihelper functions ...
1
vote
1answer
274 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, ...
1
vote
0answers
295 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
179 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 ...
1
vote
0answers
418 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 ...
1
vote
0answers
370 views

cocos2d-xna CCScale9Sprite usage

I'm trying to get a CCControlButton to render on my game. Using a basic CCScale9Sprite as the button's background works using the following: var myScale9Sprite = ...
1
vote
0answers
111 views

Masking a CCLayer

I have a CCLayer (itemLayer) that has a bunch of CCMenuItemImage (itemButton) objects in it placed vertically in a column. These itemButton objects go way past the bounds of the screen and the ...
1
vote
0answers
221 views

How do I use Objective-C libraries in Cocos2d-x?

We've created several libraries in Objective-C in the past, and now we're moving to the Cocos2d-x game engine. We can't figure out how to reference and use those libraries (we've also tried compiling ...
1
vote
0answers
229 views

Getting contour without the background [closed]

I have a texture and vertex which are needed to create a set of closed polygons. For this purpose I use these functions: Code for create texture: CCSprite* spr = ...
1
vote
1answer
287 views

Adjust sprite bounds of the visible part of texture

Is there any way to adjust the boundaries of the visible part of the sprite? To make it easier to understand: I have a texture, such as shown at figure 1. Then I break it into pieces and fill the ...
1
vote
0answers
3k views

Where can I find some Cocos2dx beginner tutorials? [closed]

I have tried to start programing with Cocos2dx but I have no idea where to start and the tutorials are no very not very helpful. What I am looking for is some tutorials/guides on how to begin using ...