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

learn more… | top users | synonyms

0
votes
3answers
1k views

Sprite Animation Software That Works With Cocos2D [closed]

So the title basically says it all. I'm looking for software that would help me to create sprite animations that I could use with cocos2d by allowing me to pose a a sprite and the software create ...
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
381 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 ...
-1
votes
1answer
293 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
-2
votes
1answer
1k views

How to make Moving road/track for android game? [closed]

I am very much new to Android game development. and i have little idea about the canvas and open GL. in one of my requirement i wanted to draw a moving road/track(Jazzy). how should i start. please ...
3
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 ...
3
votes
2answers
3k 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
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
629 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
0answers
618 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 ...
2
votes
2answers
588 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
365 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.
3
votes
2answers
4k 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 ...
1
vote
1answer
659 views

How can I place a ProgressBar in Android using Cocos 2d?

I want to place a horizontal progress bar in my Android application and I want to change its progress color. I used the following code, but the progress bar is not being displayed. CCProgressTimer ...
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 ...
1
vote
2answers
739 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 ?
2
votes
4answers
860 views

Changing background images frequently within a specific time range with Cocos2D

I am working on a game development project for Android. We use the Cocos2d framework. I have to design a page which contains two background images, I need to switch these images repeatedly within ...
-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
539 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"> ...
-1
votes
1answer
574 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
267 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
450 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
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 ...
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: ...
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
2answers
1k 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 ...
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
592 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. ...
-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 = ...
1
vote
2answers
966 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 ...
3
votes
1answer
688 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 ...
-1
votes
1answer
308 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 ...
1
vote
2answers
783 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 ...
0
votes
2answers
242 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 ...
0
votes
1answer
801 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 ...
-2
votes
1answer
488 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 ...
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 ...
-5
votes
4answers
1k views

Crash when using Cocos2d

Sorry about the poor question title, it's just that this seems to big for a title. So here's the dirt: I am making a game (obviously) and I want the enemies to shoot (not necessarily at the player). ...
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 ...
0
votes
1answer
730 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.
3
votes
1answer
695 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 ...
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?
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 ...
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 ...
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
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 ...
2
votes
1answer
959 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 ...