cocos2d for iPhone is a free open-source framework for building 2D games, demos, and other graphical/interactive applications for iOS devices.

learn more… | top users | synonyms

3
votes
2answers
171 views

Is it possible exchange points between players using Game Center?

I want to create a turn based two player game. In my game in a certain stage if player 1 loses he must give few points that he have to the opposite player. The game is implemented with game center. Is ...
3
votes
4answers
339 views

What is technical specs for iOS platform for a game?

I would like to know when a contractor ask you for a technical specs for iOS platform of a game, what's the description that you should give back to him?
-1
votes
1answer
306 views

What is the current state of 2D game SDK's [closed]

There seem to be so many to choose from. SDL Cocos2D-x Cocos2D-iphone Corona Unity I am having a very hard time looking these over to decide why I want to use one over the other. Advice on what ...
0
votes
1answer
218 views

Cannot find the Cocos2d templates

I am about to upgrade to the last version of Cocos2d and would like to uninstall my current Cocos2d templates before installing the new one but cannot find the templates to delete. I have looked at a ...
1
vote
3answers
1k views

Wait till all CCActions have completed

I am developing a simple cocos2d game in which I want to animate two CCSprites simultaneously, and for this purpose I simply set CCActions on respective `CCSprite's as follows. [first ...
3
votes
1answer
297 views

cocos2d mask rotation

I've been experimenting with Ray Wenderlich's tutorial about masking sprite using shaders with cocos2D 2.0. It works pretty well but now I'd like to rotate the mask independently of the masked ...
0
votes
1answer
190 views

Copies of GameScene created when called additional times

UPDATE: It no longer crashes after removing [self removeAllChildrenWithCleanup:YES]; from onExit. The artifacts still remain though. UPDATE 2: Found my problems. See my answer below. I have a game ...
0
votes
2answers
652 views

Collision detection on a 2D hexagonal grid

I'm making a casual grid-based 2D iPhone game using Cocos2D. The grid is a "staggered" hex-like grid consisting of uniformly sized and spaced discs. It looks something like this. I've stored the grid ...
0
votes
2answers
830 views

Rotating a sprite to touch [closed]

I know this has been asked before and Ive looked through peoples questions and answers all over the internet and I just cant get it to work. Im sure its down to my inexperience. Ive got an arrow ...
2
votes
1answer
655 views

Directional Lights

I'm working on a game idea (2D) that needs directional lights. Basically I want to add light sources that can be moved and the light rays interact with the other bodies on the scene. What I'm doing ...
1
vote
2answers
219 views

Crash due to removal of Elements like CCSprite from NSMutableArray

So, here's how it goes. I am currently working on Cocos2d game, which consists of many Obstacles. One obstacle gets added on the screen at an interval of 10 seconds like this. ObstacleSprite* ...
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 ...
3
votes
1answer
321 views

How do I implement a selectable world map?

I want to have a selectable map of the world, preferably zoomable, in a cocos2d project. When I tap on a country, I want that country to be selected so that I can perform some other operations with ...
2
votes
1answer
179 views

Change collision action

I have a collision detection and its working fine, the problem is, that whenever my "bird" is hitting a "cloud", the cloud dissapers and i get some points. The same happens for the "sol" which it ...
1
vote
1answer
591 views

How to make a Sprite using CoreGraphics iOS - Cocos2d-iPhone

I'm trying to make a sprite that uses the graphics that are made with core graphics. I cant seem to find anything to explain how to make shapes using core graphics to create a sprite to use in ...
2
votes
2answers
2k views

How to create array with unique sprites? in cocos2d iphone

I write the code like this. This displays only one sprite (red colour bubble) with number of times and moving down, but actually I want to display different sprites (different colour bubble) every ...
0
votes
1answer
632 views

Admob banner not getting remove from superview

I am developing one 2d game using cocos2d framework, in this game i am using admob for advertising, in some classes not in all classes but admob banner is visible in every class and after some time ...
2
votes
1answer
1k views

How to get all child with same tag from CCLayer?

Actually i am working with cocos2d Game. I am using CCLayer for particular scene. now there are so many buttons means CCMenuitems are available. I want to disable that all menuitems having same tags.
2
votes
3answers
265 views

OOP in cocos2d for ios

I have been pulling my hair out trying to make an object in cocos 2d that is a CCSprite (with an image) and a CCLabelBMFont. I tried making a CCNode object and I tried making a custom CCSprite object ...
1
vote
1answer
1k views

use of undeclared identifier 'GL_TEXTURE_COORD_ARRAY'

Anyone please help me .i am working on sneakyjoystick class when i import these class some error are identified they are following :- use of undeclared identifier 'GL_TEXTURE_COORD_ARRAY' use of ...
-3
votes
1answer
588 views

My Sprite comes out the screen

If i an action moves the sprite,how can i keep the CCSprite on the screen???? this is my code: [enemy runAction:[CCSequence actions:[CCMoveBy actionWithDuration:2.0 position:ccp(-winSize.width*0.4, ...
0
votes
1answer
207 views

How to work with two layers or more in cocos2d?

I want to make a game in cocos2d. I don't know too much about it. My question is related to communication between two layers or more. For instance, let's say I want a layer with a scrolling road and ...
1
vote
1answer
534 views

Unit Testing with Cocos2D

How to implement Unit Testing with Cocos2D framework? What are the good practices? Is there any testing framework like JUnit Framework at Eclipse for Android?
3
votes
1answer
204 views

Issue with TurnBased Multiplayer Game in Game-kit

I am working with cocos2d game in which i am implementing Game-kit. My game supports multiplayer option. Actually as given example Raywenderlich link. I am GKTurnBasedMultiplayer class from Game-kit. ...
-1
votes
2answers
486 views

2D animations frames vs 3D animation for small indie project: timing considerations

pretty lame question but was wondering.. I am developing a 2D game using Cocos2D for iOS. The art work till now is all 2D (is a shooter game) but some of the characters would benefit of complex ...
0
votes
1answer
225 views

Creating multiple fixtures in one body

I want to create this type of fixture in one body. Here square and circle both are different fixtures but attach to one body. How do I do this?
1
vote
2answers
230 views

Confusing box2d forces

Hello Friends. This is my demo game screen-shoot. Here i am using three buttons. Right-bottom button is used for jump and left-bottom buttons used for move left and right. I have some questions 1) ...
1
vote
0answers
797 views

How to properly add texture to multi-fixture/shape b2Body

Hello to everyone this is my first poste here I hope that will be not fail start. At start I must say I make part 1 in Ray's Tutorial "How To Make A Game Like Fruit Ninja With Box2D and Cocos2D". But ...
1
vote
1answer
163 views

Sprite Body can not stop

Hey i have issue regarding jump sprite body. In my code i am using moveLeft and moveRight Button and when i am press moveRight Button using following code if (moveRight.active==YES) { ...
0
votes
1answer
425 views

moving box2d bodies in an arc or curved path

How can I make a b2Body move in a arc-like or curved path? I have heard about cocos2d Bezier curve function (ccBezier) but this is for moving cocos2d sprites. Or can it be modified to move box2d ...
2
votes
1answer
312 views

Wheel rotation, to change velocity of vehicle

I update the velocity of my vehicle like so: [v setVelocity: ((2 * 3.14 * 100 * (wheel.getRotationValue / 360) / 30)) * gameSpeed]; // update on 60 fps this gets velocity on all frames divide by 60 ...
0
votes
1answer
584 views

EXC_BAD_ACCESS error when box2d joint is destroyed

When I destroy the weldJoint in the update method (see below) I get an EXC_BAD_ACCESS error pointing to the line world->DestroyJoint(weldJoint); in the update method below: -(void) update: ...
1
vote
1answer
79 views

Issues with background coordinate configuration in objective c with runAction?

In my game I want to have two backgrounds going one after the other creating a continuous loop moving to the left. However, right now one goes, and the other does not follow it. Here's what I ...
1
vote
1answer
202 views

CCTMXTiledMap continuous scrolling;

I have a vertical shooter, the game scrolls TMXTiledMap, and when it runs out I want it to load next map and scroll them seamlessly without interruption. How do I achieve that? Here is my scrolling ...
0
votes
0answers
400 views

How to make and correctly use progress bar in cocos2d-iphone?

I have a game that uses a progress bar to inform player of level of certain stats of the player. For example hunger, when it starts at zero and slowly adds up to maximum bar. When he eats the hunger ...
1
vote
1answer
2k views

What is the correct way of changing image of existing CCSprite?

How do I correctly change sprite to show another image? Or to have another texture? This is the way I do it now. When I need to change sprite image I increase state variable. So i have one picture for ...
2
votes
1answer
616 views

CCsprite.flipX not working!

Here is my function, it makes random point on the ground and makes my sprite go there. If the x position of location is less then position of my sprite, I flip my sprite so it looked left (it looks ...
2
votes
4answers
2k views

How to separate my rendering from game loop?

If I have a (complex) operation that takes a long time for it to finish, for instance, a couple of seconds, my frame rate drops far below the acceptable. How could I still implement it while it is not ...
2
votes
2answers
1k views

Cocos2d v2.0 and OpenGL 2.0/1.0: where to start

I started developing my very first game 3 months ago using Cocos2d 2.0 for iPhone. I am now in the stage where I'd like to add some cool effects to the bullets and some special weapons (see my ...
0
votes
1answer
190 views

How to use generic level editors with my arbitary code?

I have a game, breakout clone. It has a Block class that contains CCSprite as a property. Usually I made levels by manually setting those blocks to positions. Here comes the question, how do I use ...
1
vote
1answer
405 views

Cocos2d: Using single timer/scheduler for multiple sprites

want to know if is it possible to use single timer or scheduler method for multiple sprites ? Like I am now working on a game and there could be any number of sprites and i want to perform some ...
2
votes
0answers
316 views

Box2d based tile map game scrolling problem [closed]

I am using a tile based game and also used a joystick. Using joystick sprite body move perfectly but tile map can not scroll. -(void)setCenterOfScreen:(b2Vec2)position { int ...
3
votes
2answers
543 views

Creating 2D waveform for Cocos2d game

I'd like to have a Waveform in my iPhone game that I am developing using Cocos2d v2.0. That's the ideal wave I'd like to achieve. A simpler wave which I would still be happy with is this one. ...
2
votes
1answer
4k views

Accelerometer to move player left and right

Please take a look on my code and help me to find problem. I used this tutorial: COCOS2D_ACCELEROMETER_MOVEMENT This works only sometime….some time not move..How can I resolve this problem? Here is ...
-2
votes
1answer
2k views

How change the size of sprite in cocos2d?

I want to change the scale of sprite like a paper in 'Paper Toss' game. 'Paper Toss' is the game is available on the App store. I want to make a sprite like a paper and change the scale of sprite ...
0
votes
1answer
534 views

Cocos2d Box2d contact listener call different method in collided object

I have the building object, wen it hit with other, i want to call some method inside it. Building.mm -(void)printTest { NSLog(@"printTest method work correctly"); } in my ContactListener i ...
2
votes
2answers
1k views

Using pixel art on small high resolution screens

I'm making a game and I would like to utilize pixel art as my style. But I faced a problem, modern displays on my target platform (iOS) have extremely high resolution. So if my artist makes me some ...
1
vote
1answer
553 views

How make a laser path prediction line like a “slingshot cowboy” game?

How so I make a laser path prediction line like a “slingshot cowboy” game in cocos2d or box2d and select the target like "slingshot cowboy" game.
0
votes
1answer
374 views

How to store level information on iOS

Let's imagine I have a breakout game. I make a level like this: For columns < max columns For rows < max rows Create sprite from file, put it on some position based on ...
1
vote
0answers
237 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 = ...