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

learn more… | top users | synonyms

0
votes
0answers
26 views

NSNotificationCenter or array of delegates to broadcast information?

I'm writing a buff class that will have a delegate to the caster and an array of delegates that call the affected objects (can be tiles or sprites). After some research on how to create an ...
0
votes
2answers
75 views

Serious gameplay issue by spawning enemies according to elapsed time

EDIT: I have changed the title as I think that this is a general gamedevelopment question but, on a technical note, I am using Cocos2d v2.0 Some time ago I had asked a question on which was the most ...
-2
votes
0answers
37 views

Cocos2d Android How to fling sprite with screen swipe? [closed]

I'm trying to implement the ability to fling a sprite in any direction by grabbing it and swiping it across the screen in that direction. I would like its speed to depend on the swipe done with your ...
1
vote
1answer
22 views

Cocos-2D asteroids style movement (iOS)

So I have a CCSprite subclass, well call this Spaceship. Spaceship needs to move on a loop, until I say othersise by calling a method. The method should look something like - ...
-4
votes
0answers
20 views

How to run animation with joystick position? [closed]

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"walkcycle.plist"] ; spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"walkcycle.png"]; [heroWorldLayer ...
-2
votes
0answers
70 views

How to run two animation at same time at same sprite?

In my game i am running two animation by ccspawn but it shows only one animation at a time. what i do? here is my code..... [[CCSpriteFrameCache sharedSpriteFrameCache] ...
0
votes
0answers
20 views

how to use TextFieldTTF in cocos2d html 5

i currently have this var textField = cc.TextFieldTTF.create("", "arial", 32); this.addChild(textField); but for some reasin it's not working please help thanks
0
votes
0answers
23 views

how to set resolution in cocos2d html5 game

how can i change or init game with specific resolution is there something like setResolution(width,height) available ? please hellp thanks in advance
0
votes
0answers
25 views

How to get sprites react to touches in cocos2d-android

i have 1 gun when tap on any area on the screen bullets fires out, but according to my requirement there are 3 guns(sprites) when touched on any of the sprites bullets must fire up, when googled i ...
0
votes
0answers
40 views

Android cocos2d getting collision detection to work only on some frames of animation

I have an animated bomb sprite in my game and use CGRect for collision detection: for (CCSprite bomb : _bombs) { CGRect bombRect = CGRect.make(bomb.getPosition().x - (scaleFactor * ...
0
votes
1answer
43 views

Android cocos2d getting a sprite to continuously move to a dynamic position

I tried using the MoveTo method in cocos2d to get a sprite to continuously follow my player sprite: CCMoveTo actionMove = CCMoveTo.action(actualDuration, player.getPosition()); CCSequence actions = ...
-2
votes
0answers
36 views

How to increase the score when two sprites intersect in cocos2d android

I have a sprite(image) when it collide with another score should be increament by 10, related code is given in the update method, but instead of this it increases randomly. here's my code. public ...
0
votes
0answers
19 views

Auditioning audio in real-time on iOS game

I've heard of fmod which is an audio engine came with fmod studio to adjust sounds in real-time while testing a game. But fmod requires a huge license fee so I'm looking for free alternative to fmod ...
0
votes
1answer
50 views

Android cocos2d removing a sprite after animation

I have an object going across the screen with an animation using the following code: CCSpriteFrameCache.sharedSpriteFrameCache().addSpriteFrames("ninjastar.plist"); CCSpriteSheet projectileSheet = ...
2
votes
1answer
77 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 ...
0
votes
0answers
31 views

Best strategy to group multiple CCPhysicsSprite into a single game character. [Cocos2d + Chipmunk]

It is my first game using Cocos2D with Chipmunk and I have a bit of a novice question. I am using the CCPhysicsSprite to create different parts of a character. I would like to be able to group these ...
0
votes
0answers
104 views

creating arcball in cocos 3d [closed]

I am trying to make arc ball sample in cocos 3d , the code seems to be ok, but the rotation of ball is not as expected it seems that i've done something stupid, but i can't figure it out. please check ...
0
votes
0answers
43 views

Catching an object from sky in Cocos2d and Box2d world

My world has a gravity of -9.8 and there are KDynamicBodyType bodies falling from the sky. At the bottom there is a PhysicsSprite with KinematicBodyType. I want the PhysicsSprite to be able to catch ...
0
votes
0answers
41 views

Texture / CCSprite Loading and Unloading

Here I want to know how textures are loaded and unloaded in the game by cocos2d/cocos2d-x? Basically I am a developer of AndEngine and started working with cocos2d-x. In AndEngine, we have ...
5
votes
1answer
202 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 ...
0
votes
1answer
51 views

Exporting spritesheet for Cocos2d

I would like to know how people usually save the animations in order to load them easily in Cocos2d with as few hard-code as possible. E.G. The solution I thought of is to have one plist file ...
0
votes
0answers
54 views

Cocos2d/Box2d Component based entity system

Recently I've read somewhere that it is not a good idea to inherit from CCSprite class when making your game objects. In my CBES each Game Object has : -PhysicsComponent(responsible for updating ...
0
votes
0answers
41 views

How to select a show and select weapon on touch a bubble that changes continuously weapons! [closed]

hello i need to select a weapon from a floating bubble that changes weapon inside in it ! Bubble must show 2 weapons changing randomly until user taps to gain the weapon (This lets user gain any bonus ...
0
votes
0answers
87 views

Cocos2d-xna memory management for WP8

I recently upgraded to VS2012 and try my in dev game out on the new WP8 emulators but was dismayed to find out the emulator now crashes and throws an out of memory exception during my sprite loading ...
0
votes
0answers
38 views

Image is displaying in inverse order cocos2d

I am drawing image in cocos2d using opengl call but image is displaying inverse order, i faced same problem previously that time i used to change value of CC_TEXTURE_NPOT_SUPPORT to 1 from 0 in ...
1
vote
1answer
88 views

Can I switch scenes by swipe gesture or drag?

Can I switch scenes by swipe gesture or drag? In my game, there are three main scenes, each of them has several layers which have some UI elements, these elements have some tap gesture. I already ...
0
votes
0answers
100 views

cocos2d-xna CCScale9Sprite usage

I'm trying to get a CCControlButton to render on my game. Using a basic CCScale9Sprite as the button's background works using the following: var myScale9Sprite = ...
0
votes
0answers
26 views

How to implement enemies similar to Monster shooter game in cocos2d? [duplicate]

We are recently creating game with cocos2d API. This game is similar to Monster shooter game for iOS and android. Following is the link to above game : http://game-lion.net/monstershooter/ In this ...
0
votes
0answers
46 views

Shooter enemies spawning without editor on iOS

I have found this question with some very brilliant answers. I really like the "distance from bottom of the screen" spawning approach and the fact that the enemies flow can be easily visualized on an ...
-1
votes
2answers
163 views

Semi Transparent Background in Scene [closed]

In my game I want to create game over scene which is semi transparent so game scene become partially visible. Game over scene contain several button that are not transparent but I need only ...
0
votes
1answer
178 views

Rotate Box Sprite With Circle Body

I want to rotate my rectangular sprite with circle body. The problem is the body doest not attached to the centre of the sprite. This was the default behaviour of the body and sprite. But I want that ...
1
vote
2answers
341 views

Repeat image on a fixed background, Cocos2D?

I'm quite new to Cocos2d, does anyone know how to create a background that would be one fixed screen (no scrolling), with a small image just repeated to the whole size of the screen - depending on ...
0
votes
0answers
78 views

cocos2d - exclude GUI layer transformation

I have a game layer that should be pannable and pinchable and a GUI layer as an overlay that's excluded from the transformations. I added the pinch and pan gesture recognizer to the view and set the ...
1
vote
1answer
138 views

Debug Render In Cocos2d Android

I want to implement debug render for cocos2d android.So I can view how bodies are created. Right now I use gdx.jar file for box2d and load that jar file following way. static { ...
0
votes
0answers
187 views

Cocos2d Vertical Doodle-Jump Like Scrolling [duplicate]

Good afternoon, For the past few days I've been making a game very similar to DoodleJump in the sense that it involves a main character, things to jump on, certain powerups and some monsters. I've ...
0
votes
0answers
133 views

Bike Race Concept [closed]

I am right now developing this type of game. https://itunes.apple.com/us/app/bike-race-free-by-top-free/id510461758?mt=8 I need help for following questions. I have some solutions for this but I need ...
1
vote
1answer
109 views

Preserving Cocos2D context between UIKit screens

My app is designed to use Cocos2D in the "main game screen" but the rest of the screens are in UIKit. While I feel that this isn't ideal, I really don't have time to port the rest of the screens into ...
0
votes
0answers
51 views

Problem with the multiple polygon collision

I have created the heart body used the physics editor and it gave me the 3 polygons.I have multiple heart bodies that are spawing. When it collide with car body my application hang after some ...
1
vote
0answers
176 views

Can I use a shader with 2 different textures in Cocos2D (x)?

We are evaluating a variety of different graphic engines for use in our game and we want to be able to use 2 different textures for many of our sprite maps. One sprite map would be the standard RGBA ...
0
votes
0answers
31 views

Check duplicates in the removeList in box2d iphone

sometimes a collision is called twice in that case i need to be check duplicates from the removeList. because of this my application is getting crash or hang. How can i check duplicates in the ...
0
votes
1answer
340 views

3d transformation of game world keeping gameplay 2d - COCOS2D 2.0

Using: COCOS2D + iOS. I want to rotate the game world, may be loading another .tmx file for another dimensions when user want to switch dimension. the effect what I am looking for is something like ...
-1
votes
1answer
144 views

Parallax With Box2d iphone

I am creating the simple game. In that game car will move and obstacles will come in the car way we will have to save that car from that obstacles. What I have done. I have created the car with the ...
1
vote
2answers
316 views

8-bit Game: To pre-scale images, or post scale my Cocos2d scene. Which is the better approach?

I'm wanting to develop a game with an 8-bit feel. Since this game is mostly for my personal enjoyment, I've set a requirement that I want my game to have an 8-Bit feel to it that is most similar the ...
0
votes
1answer
476 views

How to create Elastic rope / Rubber band in box2d?

I am trying to create the rubber band type or elastic rope. i ant to do something like bellow link. http://heyalda.com/smash-turtle/ Thanks,
0
votes
1answer
194 views

Remove HUD from Child Scene

For my game, I create game scene for which I set HUD to it. First my game scene use BoundCamera, so I use hud to set score text, dollar text and setting button. Now on game scene when I touch on ...
-1
votes
1answer
81 views

How to create strength meter?

I am creating game like bow and arrow. I want my hero will shoot the arrow with the strength meter, how will create the power?
2
votes
1answer
163 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 ...
1
vote
1answer
189 views

Need a bounding box for CCSprite that includes all children/subchildren

I have a CCSprite that has CCSprite children, and those CCSprite children have CCSprite children. The contentSize property doesn't seem to include all children/subchildren, and seems to only work for ...
1
vote
1answer
147 views

How to execute AI in Cocos2d (replacing the Update method)

What is the best way to run AI in Cocos2d? I already have my AI implementations. Normally I would execute AI in my game loop by checking how much time has elapsed since last AI execution and whether ...
1
vote
1answer
179 views

Game design and SoC

I've been working on a little game for the last few months, trying to approach it as a software engineer and employ best patterns and practices in my coding. I have gotten to the point where I have to ...

1 2 3 4