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

4
votes
1answer
1k views

How do I break an image into 6 or 8 pieces of different shapes?

I am working on puzzle game, where the player can select an image from iPhone photo gallery. The selected image will save in puzzle page and after 3 second wait the selected image will be broken into ...
6
votes
3answers
2k views

How to achieve uniform speed of movement on a bezier curve?

I'm trying to move an image along Bezier curve. This is how I do it: - (void)startFly { [self runAction:[CCSequence actions: [CCBezierBy actionWithDuration:timeFlying bezier:[self ...
3
votes
1answer
191 views

Verify which bubble is connected to top using DFS

I am working on a bubble shooter game in this game i have implemented searching using DFS as suggested in this link, and this is working fine. Update Here is my code for DFS ...
0
votes
1answer
278 views

Cocos2d patterns for simple texture management

I'd like to simplify the way I preload image resources in my Cocos2d based iOS apps. I've created a small object the just wraps a few of CCTextureCache's methods. It looks like this: @interface ...
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 ...
8
votes
1answer
3k views

Basic Box2D collision detection

I don't understand how to listen for collisions in Cocos2D/Box2D. Say I have two dynamic circle bodies. One is very small and the other is relatively large. When the small circle collides w/ the ...
5
votes
2answers
2k views

How to make animated buttons in a menu with Cocos2d?

How do I make animated menus with cocos2d, I just want to animate the buttons and not the entire scene. Effects I look for is flipping buttons (like the back of the button is the next menu), buttons ...
3
votes
2answers
1k views

When and how should I apply forces in a Cocos2D + Box2D game?

I have some small circles just rolling across the bottom of the screen in my Cocos2D/Box2D iOS app. The bodies are dynamic... so I make them roll by applying a horizontal force to the center of mass ...
12
votes
5answers
915 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 ...
2
votes
2answers
835 views

Simple 2D Flight Physics with Box2D

I'm trying to build a simple side scroller with an airplane being the player. As such, I want to build simple flight controls with simple but realistic-feeling physics. I'm making use of cocos2D and ...
0
votes
1answer
205 views

iOS with cocos2d to MVC or not to MVC?

I am working with cocos2d. All my objects are declared on the CCLayer that I'm using, I have the logic of the game there and all the CCSprites. Should I put the CCSprite for the player and all it's ...
5
votes
2answers
2k views

How to make Snake Body in Snake Game?

I'm new in cocos2d and game dev. I'm still learning in game dev. My goal is to make one game like Doodle Grub. But problem is snake body. I wrote like following -(void)update:(ccTime)delta { ...
4
votes
1answer
396 views

Collision Filtering in Box2D

I have four bodies in my Box2D World. Each are polygon shape, with some physics parameters. Now when the game start, I need one of the bodies from the World (BodyA) to not be allowed to collide with ...
3
votes
2answers
449 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. ...
1
vote
0answers
176 views

Detect Sprites, they are in Shape or Not which random draw in Cocos2d

I have searched a lot on web and found some of help ful links as exact my question. Link 1 Link 2 But still i am not success to achieve this, i have done some of code lines, as like draw line by ...
1
vote
2answers
840 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 ...
1
vote
1answer
1k 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 ...
1
vote
2answers
292 views

How can I make a rectangle to an irregular shape?

I used masking for breaking an image into the below pattern. Now that it's broken into different pieces I need to make a rectangle of each piece. I need to drag the broken pieces and adjust to the ...
1
vote
1answer
1k views

Making an object swing from one rope to another

I am trying to make a Tarzan like game with Cocos2D and Box2D. I am having issues with the physics - making an object swing from one rope to another. I am not really sure how to do this. Could anyone ...
1
vote
2answers
1k 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
2answers
1k views

Top down water view, cocos2d

Has anyone successfully created a top down view of a stream/river? I need to also work out how to make it look like a boat is cutting through the water.