cocos2d is a free open-source framework for building 2D games, demos, and other graphical/interactive applications.
1
vote
3answers
886 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 ...
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 ...
1
vote
1answer
174 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 ...
0
votes
1answer
45 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
1answer
363 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 ...
-1
votes
1answer
210 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
votes
1answer
406 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.
...
-3
votes
1answer
169 views
Simple question about a cocos2d based game template
I am learning a cocos2d based Game template tutorial from here and now I am at this point of the tutorial. My question is, how can i run 30 different scenes in 30 different levels of 5 chapter? Now I ...
-4
votes
1answer
228 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)
{
...
2
votes
0answers
130 views
How to achieve 'forward' movement (into the screen) using Cocos2D?
I'm interested in creating a 2.5D first-person shooter (like Doom) and I currently don't understand how to implement the player moving forward. The player will also be able to browse around the world ...
2
votes
0answers
89 views
How to use a mask texture with Kobold2D
I am an iOS developer but I'm new to cocos2d. I'm working on new game, I use Kobold2D, have cocos2d installed too, and I want to make this effect:
I know how is done with Flash, but can't make it ...
1
vote
0answers
163 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 ...
1
vote
0answers
354 views
Split Body and Sprite
I want to split the body and sprite into multiple pieces as like following link suggest:
http://www.raywenderlich.com/14302/how-to-make-a-game-like-fruit-ninja-with-box2d-and-cocos2d-part-1
I try to ...
1
vote
0answers
179 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 ...
1
vote
0answers
389 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 ...
1
vote
0answers
396 views
How to create a collidable map with tiled for cocos2d (Android)?
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 ...
0
votes
0answers
10 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
0answers
9 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
13 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
0answers
21 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
35 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
38 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 ...
0
votes
0answers
46 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
70 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
36 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
76 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
44 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 ...
0
votes
0answers
70 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 ...
0
votes
0answers
47 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 ...
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
0answers
156 views
cocos2d fragment shader transparency
I'm playing with custom fragment shaders for a CCSprite (see http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0).
But I can't figure out why I get a white color whith the ...
0
votes
0answers
169 views
Cocos2d Tiled Dynamic Object Layer
I'm trying to develop a cocos2d tiled based game using a sort of 'dynamic' object layer. What I want to do is after the tiled map is loaded, the user can drag something into the map and that will ...
0
votes
0answers
121 views
Cocos2d update leaking memory
I have a weird issue - my app is leaking memory on device only, not on a simulator. It is leaking if i schedule update method anywhere, on any scene. It is leaking despite update method is empty, ...
0
votes
0answers
220 views
Carousel level selector
In my cocos2d game I need the user to select a menu so I was hoping that they could use a carousel (like the one in ski on neon or sonic racing for the iPad). I realized that there is nothing for this ...
0
votes
0answers
174 views
How to attach an object to a rotating circle?
I am trying to make an object get attached on a collision point to a circle that is rotating, but the player needs to get attached with a constant point on the player. For example the player is moving ...
0
votes
0answers
32 views
Cocos2d copied actions not responding?
I am running an animation on 2 sprites like so:
-(void) startFootballAnimation {
CCAnimation* footballAnim = [CCAnimation animationWithFrame:@"Football" frameCount:60 delay:0.005f];
spiral = ...
-1
votes
0answers
22 views
Applying the vector of a swipe movement to a box2d object
Hi I'm trying to achieve game functionality where the player can place their finger on an object then swipe in a certain direction and apply the speed and velocity of the swipe to the object they have ...
-1
votes
0answers
18 views
FlipX Sprite By Checking Position
I have bird flying. My bird is flying but i want it to fly right and left using flipX.
I want when my bird fly right it should flipx=No and when it goes left my should flipX=Yes.
simple like duck ...
-2
votes
0answers
21 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 ...


