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
2k views

Cocos2d CCSpriteFrameCache: couldn't load texture file

I am currently doing this Cocos2d tutorial: http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d ...and get the following error messages: 2011-12-30 16:36:28.536 ...
0
votes
0answers
206 views

detect sprites by tag in parallax

I've created 3 layers and added to a parallax node in my game play scene; I don't know why it crashes when I'm enabling touch, self.isTouchEnabled = YES; on one of my layers; I want that touch to be ...
2
votes
1answer
5k views

cocos3d versus Unity for simple IOS 3D games?

Wondering if anyone here happens to have experience in doing some simple 3D based games/apps for IOS, using cocos3d & Unity and could give some pointers....questions I have are: GENERAL 1) It ...
1
vote
2answers
2k views

Cocos2d Composition using CCSpriteBatchNode

I'm making a game in objective-c using cocos2d. I have the following: @interface Player : CCNode { CCSprite *mySprite; CCSpriteBatchNode *sceneSpriteBatchNode; //... } @property ...
1
vote
1answer
462 views

How can I scroll sprites when swiping using Cocos2D?

I'm adding 3 sprites (layers) to CCParallaxNode: BGLayer = [CCSprite spriteWithFile:@"Layer.png"]; [_backgroundNode addChild:BGLayer z:2 parallaxRatio:layer1Speed ...
1
vote
3answers
1k views

Making smooth walk/jump/fly etc animations

i am soon gonna start with developing my own game for the iOS, i have the plan and idea of the game ready. BUT i have 1 question. How do people make such a smooth animation? Lets take for example: ...
2
votes
1answer
443 views

Z-order for cocos2d top-down game with sprite batching

I'm trying to understand how to create z-order system like you can see in http://www.realmofthemadgod.com/ Character is above the tree when he is in front of it and vice versa. Also, I'm planning to ...
1
vote
1answer
296 views

How can I create a curved line composed of images?

I have 50 little images. All are connected each other, as in a line, sort of like a cord. I want to move one of the node images and have the rest follow along like a cord, so they become a curve.
1
vote
1answer
940 views

How to animate a flip of a card in Cocos2d?

I am working on a card game and would like to ask if someone could advice me how to implement a flip of a card in Cocos2D?
0
votes
0answers
808 views

Cocos2d Box2d how to shoot an object inside the screen [closed]

I have the code below : - (id) initWithGame:(mainGame*)game { if ((self = [super init])) { isTouchEnabled_ = YES; self.game = game; CGSize size = [[CCDirector ...
0
votes
1answer
229 views

Setting up CCMenu for Cocos2d

I am very new to Cocos2d programming and was thinking to build up my first app. I learnt some basics related to CCMenu and CCMenuItems. But I was wondering whether I could provide animations in such a ...
2
votes
2answers
436 views

Physics in carrom like game using cocos2d + Box2D

I am working on carrom like game using cocos2d + Box2D. I set world gravity(0,0), want gravity in z-axis. I set following values for coin and striker body: Coin body (circle with radius - ...
2
votes
1answer
1k views

Objective-c Cocos2d moving a sprite

I hope someone knows how to do the following with cocos2d: I want a sprite to move but not in a single line by using [cocosGuy runAction: [CCMoveTo actionWithDuration:1 position:location]]; What ...
1
vote
1answer
929 views

Smooth animation in Cocos2d for iOS

I move a simple CCSprite around the screen of an iOS device using this code: [self schedule:@selector(update:) interval:0.0167]; - (void) update:(ccTime) delta { CGPoint currPos = self.position; ...
-4
votes
1answer
147 views

How can I initialize 15-20 sprites with the same starting position?

How can I load 15-20 sprites in Cocos2D at the same point (ccp(20,20), which is an alias for CGPointMake) using NSArray? This is what I'm doing now, and it doesn't work: int i,endvalue=3; ...
2
votes
3answers
2k views

How do I create this underwater effect with Cocos2D?

http://vimeo.com/2461697 Hi everyone, I'm trying to create an effect like this, the underwater effect (water distortion). I've looked around and I've seen references to "water caustics" but I'm not ...
1
vote
1answer
616 views

How to make box2d mouse joint works similar to box2d setposition

I want to make b2mouse joint working similar to b2setposition, though i know in mouse joint force is applied, so it's not possible to reach the desired point without any delay like setPosition(), but ...
5
votes
4answers
868 views

How to port a game from IPad to Iphone

I just finished developing a 2D side scroll game for the IPad using Cocos2d and Box2d. Now we want to make an IPhone 4 version of the game, but I'm still not sure what is the best way to do it. I ...
-1
votes
1answer
408 views

How can I solve these errors when using SimpleAudioEngine?

I want to use SimpleAudioEngine for the music in a cocos2d game I'm working on. When I import SimpleAudioEngine.h in my game layer I get syntax errors in CVPixelBuffer.h and CMFormatDescription.h. ...
1
vote
0answers
155 views

Which is the best model to present the destruction of the building in Box2D?

We'd like to create a "world-destruction" game. The problem is in choosing the best model for building destruction. On my mind the building would be an array of objects( tiles). Each object would ...
7
votes
1answer
5k views

Blend Modes in Cocos2D with glBlendFunc

We've been trying to replicate the most common blending modes that are available in Photoshop and Quartz 2D, but we've only come up with 3 and that's after some long searching online. For anyone ...
1
vote
1answer
789 views

Detecting right/left collisions with a bounding box

I'm building a platformer in cocos2d, my first game project. I'm working on movement and collision detection. I'm using a tilemap with a "meta" layer of invisible blocks that are designated ...
1
vote
1answer
337 views

animation in Rhythm game similar to Jubeat Plus

For a school assignment I am planning to make a game similar to Jubeat Plus on the iPad. Right now, I have a counter that gives me each 16th note of a beat, I am reading out a Property List where I ...
1
vote
2answers
910 views

Setting up collision using a tilemap and cocos2d

I'm building my first platformer using cocos2d and a tilemap. I'm having trouble coming up with a decent way of determining if the character is colliding with an object. More specifically, in which ...
1
vote
2answers
635 views

How to stretch and rotate an image between two points in cocos2d?

I have an arrow image. I want to stretch this image between two given points. I'm retrieving the points from touch locations, so they aren't fixed. When the user touches the iPad, the arrow image ...
-1
votes
1answer
596 views

Help: -[GameScene spiderBelowScreen]: unrecognized selector sent to instance 0x257f50

I am currently doing the tutorials in the book: "learn iPhone and iPad cocos2d Game Development" by Steffen Itterheim and have been running into problems with the code for the DoodleDrop tutorial, ...
1
vote
1answer
239 views

Cocos2d not getting the texture which is added to CCTextureCache using thread

I convert the image into texture in a thread using the following line of code to reduce the image to texture converting time. [[CCTextureCache sharedTextureCache] addImage:@"imageName"]; But when i ...
0
votes
0answers
1k views

How to animate a Cocos2d sprite in a shake-like motion (earthquake)?

Does cocos2d (iPhone) have an action/animation to shake/vibrate a CCSprite? Of course I could build a CCSequence to do that, but I thought that cocos2d may already have such an animation implemented. ...
1
vote
3answers
2k views

How to determine an irregular area of a CCSprite?

In my simple game I use boundingBox for pick coins and other stuff, but I need use irregular area detection of Sprite(with out Alpha)... There is alternative to boundingBox? Here is code: ...
1
vote
1answer
1k views

Count number of CCSprite added to a CCLayer

Does cocos2d has a method that returns the amount of CCSprites added to a CCLayer? A have SceneControlLayer object, and I added some CCSprites to it. @interface SceneControlLayer : CCLayer { } ...
1
vote
1answer
118 views

velocity question from book iPhone

I am reading an iphone game dev book and I have a question about velocity. mainly it is this line playerVelocity = ccp(playerVelocity.x * dec + acceleration.x * sens, 0); Why do you mutiple the ...
0
votes
1answer
977 views

How to make the accelerometer work in different angles

I am working on some Cocos2D tutorials (doodle drop) and have downloaded the program on my device. The program is working but I have to hold the iPhone in a very specific, and not very good, angle to ...
2
votes
1answer
1k views

How to extend Tiled and Cocos2d to create an Isometric map that supports elevation

I've been looking and looking and looking, and I cannot seem to find a solution out there for making a game that uses cocos2d and Tiled to make an isometric map that supports elevation. I am not ...
8
votes
2answers
582 views

Where do I store strings? What's an efficient way of loading them?

I'm making a top-down RPG for iPhone. I'm using tilemaps (CCTMXTileMap) and the cocos2d-iphone engine. I've made a class that can handle loading maps and NPCs onto the screen, a class that handles ...
3
votes
1answer
685 views

create a simple tilemap programatically

i am working on a tile roguelike i got some of the basics working using this tutorial http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d but i want to be able to create a ...
-5
votes
5answers
2k views

How can I implement projectile motion like Angry Birds? [duplicate]

Possible Duplicate: Tracking Object Position - Firing on a Trajectory I need help in implementing the projectile motion in my game as was implemented in Angry Birds. Please help.
2
votes
2answers
830 views

The best way to communicate between multiple iPhones/iPads in a card game

I have been looking around for information about this topic but not found what i need. Here is the scenario, i am planning a card based game (cocos2d) where the idea is that up to four players should ...
4
votes
1answer
458 views

Worth using Box2d for collision but not physics?

I am currently doing some work in cocos2d-x and am thinking about using their box2d implementation for things like collision detection (but not necessarily response), range detection, and other things ...
0
votes
2answers
221 views

Slow motion of a spherical object on an blunt slant obstacle

In cocos2d environment and box2D when an spherical object falls on a blunt slant obstacle, it moves really slowly, that's nauseating, if you have coded to not to have any interaction with world while ...
1
vote
1answer
826 views

CCLayerColor gets black when pushed onto the current scene

In my cocos2d iphone project I have one major layer, the game layer. When the user presses the pause button the scene is paused and another scene is pushed onto it, the pause scene. [[CCDirector ...
3
votes
2answers
462 views

How to deal with procedural terrain, pre-load or real-time calculation?

I have developed an algorithm that generates 2D terrain coordinates for my iOS 2D game. This may be a possible visual output: The coordinates are stored in a 2D array. mVertices[i][0] = ccp(sx, ...
0
votes
1answer
502 views

How to manage game components and their attributes?

Currently I am working with cocos2d for the iPhone. I want to make my game structured and consequential. How to manage all the game components? What do I mean with game components? A game component ...
8
votes
2answers
1k views

How to create 2D game terrain?

Last month, I experimented a lot in game development using cocos2d for the iPhone, especially on moving and modifying sprites. However, vertices and polygons are still new stuff for me. I developed ...
-1
votes
1answer
277 views

Is it any good to make play game in zoom condition?

I'm developing a game with large obstacle and sprites(in cocos2d+box2d for iPhone), then after zooming out my sprites and layer (by increasing cameraZ), I make my game to play by user, which causes ...
3
votes
4answers
495 views

Who controls my player's movement?

In my game, does my player object control the movement, or does the map object control it? (Or some other object?) The player doesn't know about the map's contents to stop at solids, interact with ...
1
vote
1answer
507 views

Retrieving latest touch to interrupt another

In Cocos2D for iPhone, I want the latest touch event to interrupt another and ignore the last touch. Let me know if I need to elaborate more, but basically my game consists of a lot of finger ...
4
votes
3answers
560 views

Determine animation frame from interval

I have an array of sprites that are displayed in-order to make an animation. There is code in an update loop that has access to a value 'time' indicating how far along the animation is. Time is a ...
1
vote
1answer
955 views

ERROR: The application bundle does not contain a valid identifier

I'm getting this error "The application bundle does not contain a valid identifier" after my application successfully compiles.This error prevents my game from launching on the phone or the simulator. ...
1
vote
3answers
1k views

What is the best way to learn Cocos2D? [closed]

I've messed around with iPhone development for a couple years now. I've done some contract work. I want to get into Cocos2D to develop a game idea that I have. I was wondering what might be the ...
1
vote
1answer
742 views

Stretching textures for CCSprites in Cocos2D

I'm making a game for iPhone and iPad w/ Cocos2D and Box2D. I scale the size of square objects ("blocks") using a pixel-to-meters ratio depending on the particular device. Can I stretch or shrink ...