cocos2d is a free open-source framework for building 2D games, demos, and other graphical/interactive applications.
0
votes
1answer
59 views
Sprite sheet resolutions and Tile Maps
I am making a game using Cocos2d-x and want to support multiple mobile phone resolutions and sizes.
Right now I have made my game sprite sheets set on a resolution of iPad Retina's resolution of ...
0
votes
0answers
29 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 ...
-2
votes
0answers
38 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
3answers
942 views
Moving camera in large view
In my cocos2d app I was wondering how to make a CCSprite move on the screen but have the screen focused on the CCSprite, so when the sprite moves the view moves with the CCSprite. Is there a tutorial ...
0
votes
2answers
77 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 ...
3
votes
4answers
5k 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 ...
1
vote
1answer
190 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
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
- ...
0
votes
1answer
374 views
Store and create game objects at positions along terrain
I have a circular character that rolls down terrain like that shown in the picture below.
The terrain is created from an array holding 1000 points. The ground is drawn one screen width infront and ...
0
votes
1answer
52 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 ...
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 ...
-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
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 = ...
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
2answers
85 views
Can CCAnimations be paused?
I am new to cocos2d. I am using CCAnimation. It's working fine, except I want to pause the animation occasionally. How do I do this?
Here's what I'm doing so far:
[mySprite ...
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 * ...
-2
votes
0answers
37 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
53 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
105 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
1answer
94 views
using lua in kobold2d to control parameters
Is there a tutorial on using LUA in Kobold2d?
I want to know if its possible to use it to control the game behavior (like max speed decrease of timer, and bonus points) by uploading a new script to ...
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
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 ...
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
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 ...
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
165 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
347 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
135 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 ...
2
votes
4answers
497 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 ...
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
189 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 ...
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
177 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
1answer
346 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 ...
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 ...



