Tagged Questions

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

0
votes
1answer
419 views

Alternatives to NSMutableArray for storing 2D grid - iOS Cocos2d

I'm creating a grid-based iOS game using Cocos2d. Currently the grid is stored in an NSMutableArray that contains other NSMutableArrays (the latter are rows in the grid). This works ok and performance ...
1
vote
0answers
363 views

Any Good Cocos2d Pause Menu Library [closed]

Background : From http://code.google.com/p/cocos2d-iphone/issues/detail?id=173 Scenes/Nodes doesn't support the CocosNodeOpacity protocol. From ...
3
votes
1answer
203 views

GUI device for throwing a ball

The hero has a ball, which shall be thrown with accuracy in a court on iPhone/iPad. The player is seen from above, in a 2D view. In game play, the player reach is between 1/15 and 1/6 of the height of ...
1
vote
0answers
136 views

cocos2d event handler not fired when reentering scene [closed]

I am encountering a very strange problem with my cocos2d app. I add a sprite to the page and have an event handler linked to it which replaces the scene with another scene. On that page I have ...
2
votes
2answers
421 views

Importance of scripting engine at Cocos2d Game Engine

Each Game Engine is different and solves different problems in different ways, so the engine design does vary greatly from engine to engine (even though a lot of principles are shared from engine to ...
1
vote
2answers
1k views

How to deal with Character body parts from Design to Cocos2d

I'm trying to figure out the pattern the game developers use together with game designers: See the picture below with the independent parts: Questions: 1) Should I create different image parts ...
3
votes
2answers
173 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
363 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
317 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
244 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
2k 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
310 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
212 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
697 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
923 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
683 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
237 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
336 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
181 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
636 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
695 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
277 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
615 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
222 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
549 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
211 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
498 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
243 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
245 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
833 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
173 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
453 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
318 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
621 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
209 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
1answer
426 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
674 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
193 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
435 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
324 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
568 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
5k 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 ...