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

learn more… | top users | synonyms

1
vote
1answer
535 views

Unit Testing with Cocos2D

How to implement Unit Testing with Cocos2D framework? What are the good practices? Is there any testing framework like JUnit Framework at Eclipse for Android?
0
votes
1answer
527 views

what is the difference between CCSprite and a PhysicsSprite?

I am new to Cocos2D and I've realized that most of the codes written before the Cocos2d update used CCSprites. Recently I realized a lot of more recent codes after the update are using PhysicsSprite. ...
1
vote
1answer
2k views

How to animate the sprite along with action in Cocos2d?

Cocos2d-android - I have an animation which has 5 Frames they are close cropped images. Now I want Sprite to do animation as well as Move in X direction.i.e. I have a player running which gets ...
2
votes
1answer
399 views

Which data structure should I use for dynamically generated platforms?

I'm creating a platform type of game with various types of platforms. Platforms that move, shake, rotate, etc. Multiple types and multiple of each type can be on the screen at once. The platforms will ...
4
votes
1answer
501 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
1answer
267 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 ...
2
votes
1answer
4k views

Accelerometer to move player left and right

Please take a look on my code and help me to find problem. I used this tutorial: COCOS2D_ACCELEROMETER_MOVEMENT This works only sometime….some time not move..How can I resolve this problem? Here is ...
-2
votes
1answer
922 views

Cocos2D game engine javascript is too slow on mobile

i developed a game using cocos2D javascript that works fine on web browsers but when i run it on mobile ( iPhone 4s , android nexus) the FPS was dropped to 20 - 22 on iPhone (max) how to optimize it ...
-1
votes
1answer
409 views

Help with Music Rhythm Game (Cocos2D)

I'm basically new to the whole idea of Cocos2d.. i am aware of CocosDhension.. however, i still cant get the idea of working around it.. My idea, i would like to try to create something like "Tap ...
3
votes
1answer
679 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 ...
0
votes
1answer
2k views

How to simulate a water splash effect?

I need to achieve the effect of a ball falling down into a pool then splashing in the water. At first, I made a sensor to detect the collision between the ball and the water and then show the sprite ...
4
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. ...
-2
votes
1answer
1k views

Rolling a 3d die in cocos2d

How can I have a 6 sided die in my cocos2d game and when the device is shaked the die rolls and shows a number? I would also use UIKit if it was necessary.
0
votes
1answer
318 views

Touching a CGRect

In my cocos2d app I am trying to determine when a CCSprite is touched Here is what I have: -(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ NSMutableArray *targetsToDelete = ...
0
votes
2answers
165 views

Falling images that can be pressed

In my cocos2d app I am trying to make images fall from the top of the screen and detect when they are pressed. I am having a hard time. Can anyone help me achieve this? Thanks.
2
votes
1answer
184 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 ...
1
vote
1answer
308 views

Adjust sprite bounds of the visible part of texture

Is there any way to adjust the boundaries of the visible part of the sprite? To make it easier to understand: I have a texture, such as shown at figure 1. Then I break it into pieces and fill the ...
4
votes
1answer
481 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 ...
1
vote
2answers
685 views

Using two joysticks in Cocos2D

Here is what I am trying to do: With the left joystick the player can steer the figure and with the right joystick it can attack. Problem is that the left joystick seems to get all the input, the ...
3
votes
1answer
437 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 ...
0
votes
1answer
217 views

Rotation based on x coordinate and x velocity?

-(void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { float deceleration = 0.3f, sensitivity = 8.0f, maxVelocity = 150; // adjust velocity based on ...
0
votes
2answers
2k 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.
0
votes
1answer
680 views

Cocos2D: Change animation based on joystick direction

I'm trying to get my figure to look in the right directions, based on the input of the joystick. So if I tilt left it looks left and the left animation is used, if I used right, it looks right and ...
2
votes
1answer
373 views

Image 1 becomes image 2 with sliding effect from left to right?

I would like to show a second image appearing while a "door" is closing on my character. I've got my character in the middle of the screen and a door coming from the left. When the door passes my ...
-1
votes
1answer
162 views

Make a CCSprite come up from bottom of the screen in intervals

I have a cocos2d iOS app. I have a CCSprite that I need to come up from the bottom of the screen every few seconds (like 2 or 3 seconds). How would I do this?
0
votes
1answer
889 views

Shaders in Cocos2d 2.0

I'm thinking of using cocos2d 2.0 for my next project and am wanting to know if it's possible to have a shader that renders to a texture and that texture be input into another shader? I have a few ...
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 ...
2
votes
1answer
448 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 ...
6
votes
1answer
635 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). ...
1
vote
1answer
2k views

Best way to create a level editor in java [closed]

I am creating an iPhone game using cocos2d + box2d that needs a lot of levels. My friends and I are creating the game and most of them have no programming experience and end up with nothing to do. I ...
1
vote
2answers
3k views

Problem using ccTouchesEnded/ccTouchesBegan to move sprite in cocos2d-x?

I'm using ccTouchesBegan/ccTouchesEnded to move sprite from one point to another but I'm having problem, if i give two or more consecutive inputs one by one while sprite is moving(runAction is being ...
-4
votes
1answer
408 views

“Null Pointer Exception” Animating sprite in cocos2d android [closed]

I am converting this monkey jump game tutorial in android. I have done til monkey sliding right to left and left to right but I am stuck in the part of monkey walking animation. I have tried but ...
1
vote
2answers
667 views

CCSpriteFrameCache: Frame '%s' not found

I have just started using the Cocos2D library for Android. I am trying to make a walking bear animation. For that I am using a CCSpriteFrameCache, but I'm getting a "frame not found" error in the ...
1
vote
0answers
262 views

Cocos2D and iPhone's accelerometer

good afternoon! Today I've started to develop a game and I got a trouble. So, first at all I would like to say that I have no experience developing games... So, I've a CCSprite in the layer and I ...
3
votes
2answers
7k 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 ...
1
vote
3answers
519 views

How to expose game data in the game without a singelton?

I'm quite new to cocos2d and games programming, and am currently I am writing a game that is currently in Prototype stage. Everything is going okay, but I've realized a potentially big problem and I ...
0
votes
1answer
457 views

How do I manage the visibility of enemy spawn locations in a long scrolling shooter?

How do I handle the situation of an enemy spawn place being visible on a screen in a scrolling shooter? The tutorials I have seen are about setting all the enemies on a whole map only. But it is not ...
-1
votes
1answer
272 views

How to integrate ad mob ads in cocos2d android portal?

Could anybody tell me how to integrate ad mob ads in my cocos2d android app.
1
vote
1answer
627 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 ...
-1
votes
1answer
219 views

Need ideas on how to give my levels structure

I am making an iOS game for a project at school. It is going to be a tiny bit like Fruit Ninja, as in it will have different things on the screen, and when you hit them, they die, and you get points. ...
1
vote
2answers
905 views

Cocos2d: Adding a CCSequence to a CCArray

I have a problem with an action performed by a sprite. I have one CCSequence in a CCArray and I have an scheduled method (is called every 5 seconds) that make the sprite run the action. The action is ...
2
votes
2answers
691 views

Importing a windows project into android using cocos2d-x

What I am trying to do today is to import a full project to Android, but no tutorials are available for that that I have seen. My approach was to create a new android project, copy all the classes and ...
5
votes
2answers
3k 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 ...
2
votes
0answers
1k views

Opening URL in browser using C++ with cocos2d-x in iOS [closed]

I'm banging my brain against the wonderful lib xport that is cocos2d-x from the original cocos2d iOS library. What I want to ask is how to open a web link in the safari browser? I don' know how to ...
1
vote
0answers
310 views

Which game engine is more worthwhile for mobile game development [closed]

I have been thinking of starting to learn mobile game development. I recently learned that there are three popular game engines available for android: AndEngine cocos2d-android libGdx you guys ...
3
votes
2answers
355 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
791 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
743 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?