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

learn more… | top users | synonyms

3
votes
2answers
366 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 ...
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
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: ...
0
votes
1answer
846 views

glBlendFunc transparency in cocos2d?

GL_ONE, GL_ONE This makes the flamingoes transparent on: http://www.andersriggelsen.dk/glblendfunc.php but not in cocos2d using: sprite.blendFunc = (ccBlendFunc){GL_ONE, GL_ONE} How can I achieve ...
0
votes
1answer
767 views

How do I perform a slice effect like Fruit Ninja?

I want to do slice effect like in Fruit Ninja. Is there any class in Cocos2D like CCBlade? How can I use the CCBlade in Cocos2D on Android?
1
vote
1answer
364 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
2answers
575 views

Cocos2D: TileMap performance question

I´ve got a question regarding TileMaps. Each level in my game is going to be determined by the length of the tile map. I would like to create a map that will be about 5 mins (in length) long. I want ...
0
votes
1answer
876 views

Cocos2d: how to add anchor points to CCSpriteBatchNode

I am doing some tests with animations in Cocos2D using sprite-sheets. The animation works ok except that the anchor-point is in the center. I need to put it in the bottom. With the code below i am not ...
1
vote
1answer
3k views

How to create a splash (loading) screen in cocos2d for Android?

How to create a splash (loading) screen in cocos2d for Android? I need a loading screen that shows my app name and after that the next scene will show automatically. Thanks
0
votes
1answer
378 views

Determining the X, Y co-ordinates in sprite sheets

I am new to Android COCOS2D and developing a simple game to start with. I am developing a game for kids in which the kids shall spell out the names of the fruits they select. I have developed the ...
0
votes
1answer
3k views

How do I animate a spritesheet in cocos2d Android

I'm trying to animate a sprite in a spritesheet, the goal is to make the character walk from left to right. I subclassed CCSprite: CharacterSprite. this is my code: ...
1
vote
2answers
727 views

How can I disable/dim the screen when I click the pause button?

I am working in an android game using cocos2d. I want to dim the background screen when I click the pause button. How can I do this ?
-1
votes
1answer
291 views

Touching on the particular sprite from the spritesheet

I want to click on the particular sprite from the sprite sheet. For instance i have fruits sprite sheet i want to click on the particular fruit. Thanks, Jubin Mehta
1
vote
1answer
624 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 ...
2
votes
1answer
8k 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
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
0answers
612 views

How to Store the game score in android cocos2d

I calculates the score in game project using android cocos2d, in that game after finishing the first level it goes to the next level, so i want to store that first level score and also add next level ...
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 ...
2
votes
1answer
2k 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 ...
-4
votes
1answer
161 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
0answers
535 views

How to create a collidable map with tiled for cocos2d (Android)? [closed]

I am using cocos2d to create a game for Android. I am making a map in Tiled Map Editor and added a property to the ground tiles. The property name is Collidable and its value is True. Now I have ...
4
votes
1answer
3k 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"> ...
0
votes
1answer
1k views

How do I implement a subclass of CCSprite?

Can someone tell me how to subclass CCSprite on Android? I've added this snippet of code into my CharacterSprite: public static CharacterSprite sprite(String fileName) { return new ...
-1
votes
1answer
570 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. ...
-4
votes
1answer
266 views

Why does this CCSprite subclass code throw an exception?

I have one problem in inheriting CCSprites in Java. Here is part of my code: public class Block extends CCSprite { static Block temp=null; static Block newBlock(tetrominoTypes blockType) { ...
4
votes
4answers
447 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 ...
0
votes
1answer
366 views

How useful would it be to know a scripting language when developing an iOS game? [duplicate]

Possible Duplicate: Why do we use scripts in development? I just starting learning iOS game development. I plan to make games using the cocos2d framework. While reading game dev related ...
-2
votes
1answer
2k views

Objective-C to Java conversion for porting iPhone apps to Android?

can anybody help me to convert this objective-c code to android java. - (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if (_mouseJoint != NULL) return; UITouch *myTouch = ...
0
votes
2answers
2k views

How can I handle a touch event in cocos2d for Android?

How can I handle a touch event in cocos2d for Android? And how to move a sprite using ccTouchesMoved?
1
vote
1answer
591 views

Dynamic bodies with Parallax Scrolling

I have an object that has a dynamic body. Currently, I'm setting it's position to follow the sprite when the parallax layer move. After a certain event, the object suppose to fall to the ground. ...
1
vote
2answers
781 views

Cocos 2D putting things on the cocos thread or not?

We are using Cocos 2D for Android and are unsure if it's a good thing to execute our non-ui tasks on the Cocos thread as a way to get the animations in our game to pause. What is the recommended ...
1
vote
2answers
958 views

Would a box2D sensor fit my needs?

I have a object in my game that when the main character hits it, all I want to do is have the object explode and then notify the character object that a hit has occurred. Would I use a b2Body and ...
-1
votes
1answer
302 views

Insert object at index, when two objects collide

I have two arrays: one for projectiles, and one for targets. Every target and every projectile has tag, and a tag with color (source code I took from Ray Wanderlich). In my small game, when a ...
3
votes
1answer
691 views

Cocos2d+pybox2d vs Cocos2d-Iphone

Myself and two colleagues are working on making our first indie game for PC and, we decided to use Cocos2D + PyBox2D. We decided this based on what we've seen of Cocos2D-iPhone games, but I'm not ...
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 ...
-2
votes
1answer
485 views

Did first generation Pokemon games use event driven input or poll based input?

Did the first generation Pokemon games for gameboy poll for the d-pad state or was the input state done based on events? I'm currently trying to implement a similar control and I'm interested in ...
0
votes
1answer
798 views

Help implementing virtual d-pad

Short Version: I am trying to move a player around on a tilemap, keeping it centered on its tile, while smoothly controlling it with SneakyInput virtual Joystick. My movement is jumpy and hard to ...
0
votes
2answers
241 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
votes
1answer
292 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 ...
4
votes
1answer
2k 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: ...
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 ...
0
votes
1answer
728 views

How do I open the camera in a CCScene node in a Cocos2D application?

I am new to Cocos2D and I can't find the way to open the camera from the library. I want to open the camera in the my game, can any one help me with with this? Thank you in advance.
1
vote
1answer
2k views

Multiplayer game with Cocos2d-Javascript and Node.js

It is possible to make a multiplayer browser based game using cocos2d-javascript + node.js? If so, is there any tutorial about that?
2
votes
1answer
958 views

cocos2d: syncing CCAnimation frames with Box2d Shape manipulations

my cocos2d game currently has a ccsprite attached to a box2d body. during the game i apply different CCAnimations on my sprite, i would like to perform certain manipulations to the box2d body ...
0
votes
1answer
1k views

Interacting with scene from controller/app delegate cocos2d

I'm attempting to make my first cocos2d (for iphone) multiplayer game and having difficulty understanding how to interact with a scene once it is running. The game is a simple turn-based one and so I ...
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 ...
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. ...
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
837 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 ...
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 ...