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

learn more… | top users | synonyms

12
votes
5answers
916 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 ...
8
votes
4answers
4k views

Cocos2D collision detection against a random shape

I would like to brainstorm a few ways of handling how to detect a collision between a sprite and a user generated shape of some sort. For example. There are 3 objects on the screen. The user takes ...
8
votes
2answers
352 views

What is the standard way to synchronize sound effects with sprite animations?

Let's take a situation where you have an RPG with spells and each spell animations have a different number of frames and they have very different requirements for sound effects. Let's assume that each ...
7
votes
2answers
800 views

What is the correct way to implement hit detection with non-rectangular sprites?

What is the correct way to implement hit or touch detection for non-rectangular sprites in Cocos2d? I am working on a jigsaw puzzle, so our sprites have some strange forms (jigsaw puzzle bricks). As ...
6
votes
3answers
1k views

top down game - checking, drawing enemy's line of sight area with obstacles

Examples of what i'm going to need: I'm using cocos2d to draw a CCTMXTiledMap, on those tiles i'll have to draw the LOS cone. How would i test if the player is within that cone, taking obstacles ...
6
votes
1answer
207 views

Best way to determine surface normal for a group of pixels?

One of my current endeavors is creating a 2D destructible terrain engine for iOS Cocos2D (See https://github.com/crebstar/PWNDestructibleTerrain ). It is in an infant stages no doubt, but I have made ...
6
votes
1answer
569 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). ...
5
votes
1answer
2k views

Creating an isometric map with hexagonal tiles for iPad

I'm new to game development, so I need a little help. I have to write down a little game which has a floor with hexagonal tiles but it must be seen in a isometric view like The Sims. Ignoring the ...
5
votes
2answers
1k views

cocos2d Merging box2d bodies

i'm using cocos2d to build an iphone game. my game currently has two sprites: one for the main character and another for an item i should carry once he gets on him. the main character and the item ...
5
votes
2answers
815 views

On cocos2d, what is better: one monolithic game cycle or many scheduled selectors?

I am building a simple tower defense game, and I have to take a decision between two(or more, feel free to suggest other ways) to do the game cycle. Option 1: Monolithic game cycle: I could have a ...
5
votes
1answer
346 views

How to flip card by a corner?

After searching "flip card" in google and our stackexchange site, there is no result and I have no ideas about how to flip a card by a corner. I am developing a ios card game with cocos2d, in this ...
5
votes
3answers
5k views

Tracking Multiple Touches using Hash codes in Cocos2d for iPhone

How do you implement a touch hash code and reference it later? I have read about a "hash" code, but I don't understand how to use it. I want to know when two of my Sprites are touched at the same ...
5
votes
1answer
2k views

(Why) Should I choose Unity 3 or Cocos2d (or something third) for my app? [closed]

My colleague and me made an HTML 5 iPad game ( http://braille.gandzo.com/ ) and we would like to upgrade it, and our framweork is not enoguh, for what we want. Some of the things we would change are: ...
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 ...
4
votes
4answers
406 views

semi 3d walls, should I use sprite sheet or render them 3d?

I'm going to develop a game and this is just a prototype of it's graphics. Knowing that my primary target platform is iPhone, I'm wondering if it's better to create a spritesheet containing all ...
4
votes
1answer
2k views

In cocos2d's plist output, what are 'offset,' 'colorSourceRect,' and these other fields?

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> ...
4
votes
1answer
54 views

Can I create cocos2d animations without using Xcode?

I need to have someone do animation work for an iOS game I'm developing (using cocos2d), however this person does not have a Mac and as such cannot run Xcode. Is there a way for them to create ...
4
votes
1answer
1k views

Should I be subclassing CCSprites?

When I am working with cocos2d I can add CCSprites to the layer or 'stage' and manipulate them. Now, to do my ongoing calculations for movement AI and such, things that will always run, should I: ...
4
votes
1answer
4k views

How to create endless scrolling landscape using coco2d's CCParallaxNode

I created a horizontally scrolling landscape using CCParallaxNode. However it does not seem to support endless scrolling in one direction. As soon as the first image "ends" the background shines ...
4
votes
1answer
448 views

Cocos2d: Tongue effect like in Munch Time

I'm wanting to do a tongue effect for my character like the one in Munch Time( shown in pic ). The player does some action and his tongue attaches to the nearest platform. I'm thinking this is ...
4
votes
1answer
435 views

Organize a game set

I'm developing a endless running game and I'm not really sure on how to make the set. The first approach was to make a BIG set like 10240x3072 pixels so that we have a nice portion of set. After ...
3
votes
2answers
1k views

How to achieve smooth gameplay in a physics based multiplayer game? (2d)

I'm using cocos2d 2.0 and Gamekit for networking. I've got a server/client model. It works over wifi (local) and bluetooth. (Xcode 4.3, Objective C) Basically, there's a ball and 2 or more players. ...
3
votes
2answers
796 views

Presenting game center leaderboard

I have the following code: -(void)showLeaderboard { GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init]; if (leaderboardController != NULL) { ...
3
votes
4answers
8k views

What are the pros and cons of GameSalad versus Cocos2D?

I am currently using the Cocos2D framework for creating my game but I just happened to come across GameSalad and was amazed by this video. GameSalad claims to allow you to create games without ...
3
votes
2answers
366 views

Separating UI and logic in Objective-C at iOS based Games

How to separate UI and logic in Objective-C based mobile games? To develop games, I use Cocos2d library. I need a good reference to separate my UI code from game logic code.
3
votes
1answer
375 views

Smoothing rotation

I've spent the last three days trying to work out how to rotate a sprite smoothly depending on the velocity.x value of the sprite. I'm using this: float Proportion = 9.5; float maxDiff = 200; float ...
3
votes
2answers
3k views

Cocos2d rotating sprite while moving with CCBezierBy

I've done my moving actions which consists of sequences of CCBezierBy. However I would like the sprite to rotate by following the direction of the movement (like an airplane). How sould I do this with ...
3
votes
2answers
164 views

Box2d : How to apply a force to keep swinging from left to right?

i'm losing myself in this... Situation: Working on a game in cocos2d with box2d and I have a ropejoint between one fixed body and one dynamic body. When I drop the dynamic body is swings from left ...
3
votes
1answer
138 views

Snapping of irregular images in iphone puzzle app

I am working on puzzle app in which i need to snap irregular shapes as they come in contact of one another as i am new to game development so i dont have any idea how to achieve this functionality in ...
3
votes
1answer
234 views

Cocos2D Command-Line Application

Is it possible to create a terminal application which uses cocos2d? I've tried to make one using cocos2d 2.x, but it requires a MacGLView to be initialized. I need it so that I could program a ...
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
1answer
1k views

How do you create your levels containing curved slopes in Box2d?

I have just started developing games for iPhone in Cocos2d and am currently working on a Box2D prototype. I know this is not an easy start, but I have experience in the AS3 port of the physics engine. ...
3
votes
1answer
2k views

Cocos2D 2.0 - masking a sprite

I have read this tutorial about how to mask sprites using Cocos2D 2.0. http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0 But the author talks about OpenGL ES textures and ...
3
votes
1answer
655 views

How do you get textures out of a png file

I have 1 png of many different textures. I want to use these textures in my iphone game using cocos2d. I found the program "Zwoptex" where you can combine many textures to one png and create a plist ...
3
votes
1answer
1k views

Best way to prevent UIPanGestureRecognizer from firing when moving sprites in cocos2d

Im using UIPanGestureRecognizer in my cocos2d game to do drag and drop of sprites. I have a row of sprites and when I drag a sprite on top of another one, the sprite underneath it and any other ...
3
votes
2answers
319 views

How to move the object(tanker ) on slope image in chipmunk Spacemanager

I have used one polygon shape image (terrain)in my game its just like mountain and now i want to move the tanker on mountain path from one direction to other and then its turn on touching of the ...
3
votes
0answers
237 views

How to achieve 'forward' movement (into the screen) using Cocos2D?

I'm interested in creating a 2.5D first-person shooter (like Doom) and I currently don't understand how to implement the player moving forward. The player will also be able to browse around the world ...
3
votes
0answers
112 views

How to use a mask texture with Kobold2D

I am an iOS developer but I'm new to cocos2d. I'm working on new game, I use Kobold2D, have cocos2d installed too, and I want to make this effect: I know how is done with Flash, but can't make it ...
3
votes
1answer
187 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 ...
3
votes
1answer
2k views

Rendering shadow sprites in cocos2d-x

I am writing a 2D game with cocos2d-x. I want to put a "shadow" sprite on a background sprite using the equation: MAX(0, Cd * 1 - Cs * S) where Cd is the destination color (that is, a background ...
2
votes
1answer
1k views

Programmatically set color of Box2D body's sprite or image

In my basic Cocos2D + Box2D iPhone app I have a bunch of circular Box2D bodies. I'd like to change the color of the circles programatically. What's the easiest way to do this? So far I'm just ...
2
votes
1answer
238 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
232 views

Side scroll game with 8000xScreen_Height, which technique is best

I got one new requirement for iOS side scroll game with screen size : 8000xScreen_Height For this, tileMap is best or normal texture based is best? I need to use parallax background too. Help me to ...
2
votes
1answer
7k 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 ...
2
votes
2answers
323 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 ...
2
votes
1answer
408 views

cocos2d/OpenGL multitexturing problem

I've got a simple shader to test multitextureing the problem is both samplers are using same image as their reference. the shader code is basically just this : vec4 mid = ...
2
votes
1answer
708 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
1answer
286 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 ...
2
votes
1answer
180 views

Game speed cubic growth

Is it possible, using delta in my update method to increase a game speed variable exponentially on cubic growth (the blue line below) My maths isn't great so I'm not sure how the formula would be ...
2
votes
1answer
380 views

Cocos2d particle system

I have a fire particle emitter in my project and I have it following a football. My goal is to make the football look like it is on fire but the problem is when I add it to the screen it can only be ...