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
1k 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 ...
9
votes
3answers
12k 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
618 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
2k 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
759 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
370 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
3answers
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
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
1answer
893 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: ...
3
votes
1answer
605 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
1answer
60 views

How can I speed up cocos2d game engine?

I am developing a tower-defense game and I want to permit user to change game engine speed ,for example rotation speed of towers,rockets speed ,enemies moving speed ,counters and etc proportionally. ...
2
votes
2answers
1k 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
4answers
4k 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 ...
2
votes
1answer
269 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
4k 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
1answer
3k 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
576 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
2answers
670 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
0answers
372 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
346 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
233 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
249 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 ...
1
vote
1answer
134 views

How to prevent showing outside of Game Map ( Cocos2D-x ) ( Scrolling game )

I'm trying to make a tower defense game and it can zoom in/out and scrolling over my world map. How to scroll over the game and how to restrict it not to show outside of my map(black area). At below ...
1
vote
2answers
218 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
293 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
2k 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
795 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
517 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
3k 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
256 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
295 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
1answer
262 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
273 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
3k 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
2k 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
432 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
340 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
0answers
13 views

Why AnchorPoint doesn't affect `CCLayer` Positioning?

I think there is a different between CCLayer and CCNode behavior when I change their AnchorPoint. I will describe what I mean and please somebody explain it ? Scenario: I start with CCNode CCNode ...
1
vote
1answer
51 views

Cocos2d/Cocos2d-x Attaching an arrow (sprite) to another body sprite (person)

I am trying to set up a simple bow and arrow game. When the arrow hits the enemy body, the arrow's body is deleted and the arrow sprite continues to update, keeping the position correct in relation to ...
1
vote
1answer
65 views

Box2d - Attaching a fired arrow to a moving enemy

I am firing an arrow from the player to moving enemies. When the arrow hits the enemy, I want it to attach exactly where it hit and cause the enemy (a square) to tumble to the ground. Excluding the ...
1
vote
1answer
86 views

How to pause and unpause the Particular action of a sprite?

My game has a sprite representing a character. When the character picks up an item, the sprite should stop moving for a period of time. I use CCbezier to make the sprite move, like this: ...
1
vote
0answers
73 views

Weird y offset when using custom frag shader (Cocos2d-x)

I'm trying to mask a sprite so I wrote a simple fragment shader that renders only the pixels that are not hidden under another texture (the mask). The problem is that it seems my texture has its ...