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
155 views

Dynamic Hills like Contre Jour in Cocos2d

I'm interested in maps/environments which are flexible and change at runtime, such as those in Contre Jour. I have looked for a long time to find out how to make this effect, but I couldn't find an ...
3
votes
1answer
123 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 ...
0
votes
0answers
15 views

Is it possible to make such product as “Age of Zombies” using cocos2d? [on hold]

Is it possible to make such easy rpg product like "Age of Zombies" using cocos2d? I see some tutorials (http://www.raywenderlich.com/39113/cocos2d-x-tile-map-tutorial-part-1) but I guess, that it will ...
0
votes
1answer
166 views

How to use UILongPressGestureRecognizer with sprite drag & wait?

May be it's asked before also but I couldn't find any good answer. Please tell me how this can be implemented with UILongPressGestureRecognizer? A user drags a sprite from X location to Y location. ...
0
votes
1answer
31 views

Scrolling effect after touch

i'm making map for a game and need to make scrolling of map, so the main thing what i need is to calculate speed and move layer after player remove finger from screen. I make it my own, but i think ...
0
votes
0answers
35 views

Cocos2D texture distorted on android devices

The textuers are distorted (randomly) on some devices (randomly again). The game is working on IOS without problem. Checked adb logcat and I got some errors. Searched the errors but not found any ...
2
votes
2answers
120 views

Finding diagonal objects of an object in 3d space

Using Unity3d, I have a array which is having 8 GameObjects in grid and one object (which is already known) is in center like this where K is already known object. All objects are equidistant from ...
0
votes
0answers
76 views

iOS + cocos2d: how to account for sprite's position for the different device dimensions in an universal app?

All the questions I've seen regarding iOS universal apps (with or without cocos2d) deal with the "how to add graphics to a universal app". My question is, how does the code need to be written to ...
0
votes
0answers
12 views

Class or Interface expected cocos2d-android [migrated]

I'm trying to use cocos2d-android in Android Studio following this tutorial, the problem is that I'm unable to add at myactivity.java: protected CCGLSurfaceView _glSurfaceView; Because ...
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 ...
0
votes
2answers
92 views

How to define axis of Sprites in a CCAnimation?

I'm struggling to find how to define a kind of axis in my frames, when my sprite punches it moves back. I want to define the head as a pivot for the other sprites with different sizes. How can I ...
-1
votes
1answer
193 views

How to pause and unpause the Particular action of a sprite?

My game has a sprite representing a character. When the character picks up an item, the sprite should stop moving for a period of time. I use CCbezier to make the sprite move, like this: ...
0
votes
2answers
105 views

How is the environment moved in endless runner games like Tiny Wings

I've always wondered how the background seen is scrolled endlessly as the main player is moving (usually to the right). With Tiny Wings I suspect that it's somehow drawn dynamically because when ...
1
vote
0answers
31 views

Implementing debug “overlay” info

This question is actually about GameEngine2D which is part of PSM SDK (for PlayStation Vita development), however as stated in documentation it's loosely based on cocos2d library. I hope that my ...
1
vote
1answer
169 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
113 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 ...
-1
votes
1answer
412 views

How to create a rectangle shape in cocos2d-android

I am new to cocos2d-android. I want to create a rectangle shape in the scene .for that i am trying to do something like this. CGRect rect = CGRect.make(x,y,70,70); But it was not displaying the ...
1
vote
1answer
110 views

Cocos2d/Cocos2d-x Attaching an arrow (sprite) to another body sprite (person)

I am trying to set up a simple bow and arrow game. When the arrow hits the enemy body, the arrow's body is deleted and the arrow sprite continues to update, keeping the position correct in relation to ...
0
votes
1answer
96 views

Mobile: Physics and movement actions

I've been using spritekit for a while for a few small games. One thing I've noticed is that spritekit is the first game framework I've used that allows me to apply move actions to physics bodies. ...
-2
votes
2answers
276 views

How can I locate the frames of a spritesheet PNG based on this PLIST data?

Someone asked me to reskin a certain game. Now he only sent me the whole sprite PNG and PLIST files of the sprites. He instructed me to rename each sprite with the same name corresponding to each ...
0
votes
2answers
58 views

Isometric projection start point

I have a question about isometric projection: Why did in all tutorials and examples start point for isometric is in left top corner ? For example in cocos2d 3.1 my start screen point in left bottom, ...
1
vote
0answers
119 views

UI rich Strategy/RPG UI - 2D Game Engine or UI Toolkit? [closed]

I'm on the fence regarding the graphics engine of my current game and hope for some advice. This is an UI heavy strategy/rpg. Although the game is played on a (simple) 2D map, it is largely turn ...
1
vote
0answers
52 views

How to change texture from pvr.ccz in Cocos2d?

I'm using .pvr.ccz file that texturePacker application created for me , I created a Sprite that it's image choosed from this file(.pvr.ccz) like below: CCSprite *mySprite = ...
0
votes
0answers
63 views

Is there any advantage in using sprite sheets in Cocos2d-X menus?

I am developing a game using Cocos2d-X 2.3 and Marmalade SDK 7.3.1 and I was wondering if there is difference between loading the icon images that will be used in my menu buttons from a sprite sheet ...
0
votes
0answers
77 views

cocos2d-x .. How to detect which sprites are underneath a touch event

I was wondering what the best solution is in the following scenario: Lots of sprites floating around on screen. A user can touch one sprite and drag to another sprite. Throughout this entire time, I ...
1
vote
0answers
52 views

Why AnchorPoint doesn't affect `CCLayer` Positioning?

I think there is a different between CCLayer and CCNode behavior when I change their AnchorPoint. I will describe what I mean and please somebody explain it ? Scenario: I start with CCNode CCNode ...
2
votes
1answer
381 views

Why am I seeing unbounded memory usage in my WP8 game?

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

CCTextField won't appear

I can't seem to add a CCTextField in my physics node, I tried all different methods, but it's still not happening. Here's my code: CCTextField *tf = [[CCTextField alloc] init]; tf.contentSize = ...
0
votes
0answers
62 views

Error running an Action in Cocos2d-x

In my game I have a "rocket" type and I want to run a sequence of actions on it. At first it must run an explosion animation and then remove itself from the game. For this I used the following code, ...
0
votes
0answers
25 views

Maintaining a constant magnitude of speed of a CCNode's physics-body after collision with a static body

I have two CCNode class "Baffle" and "SmashBall" with there physics bodies. Here are the PhysicsBody details of Baffle // Defining the physics body CCPhysicsBody * physicsBody = ...
3
votes
1answer
93 views

How can I speed up cocos2d game engine?

I am developing a tower-defense game and I want to permit user to change game engine speed ,for example rotation speed of towers,rockets speed ,enemies moving speed ,counters and etc proportionally. ...
3
votes
1answer
1k views

Pixel Perfect Collision Detection in Cocos2dx

I am trying to port the pixel perfect collision detection in Cocos2d-x the original version was made for Cocos2D and can be found here: ...
0
votes
0answers
32 views

Animate a tile in coco2d-x

I am trying to animate a tile in my tile-based game using coco2d-x 3.0 I am using tileAt(ccp(x, y)) to retrieve my tile Sprite been when I am trying to apply animation an assert is jumping with : ...
0
votes
0answers
64 views

How to get location of sprite placed on rotating circle in Cocos2d android?

I am developing a game using Cocos2d, and I got stuck when trying to find the location of a sprite placed on a rotating circle on the background. When I hit at a certain position on the circle it's ...
2
votes
1answer
786 views

difference between cocos2d-x vs cocos2d-js

I'm just moving towards native apps... A friend of mine told me to start with cocos2d, I'm good in javascript. while searching google for cocos2d, and within cocos2d-x.org i found cocos2d-x ...
0
votes
1answer
159 views

How do I rotate a sprite with ccbezierTo in cocos2d-x?

In cocos2d-x, I move a sprite with ccbezierTo like this: // use for ccbezierTo bezier.controlPoint_1 = ccp(m_fish->getPositionX() + 200, visibleSize.height/2 + 300); bezier.controlPoint_2 = ...
1
vote
1answer
96 views

applyAngularVelocity causes error when called right after object instantiation

I'm trying to make a physicsBody rotate as soon as it is instantiated. CCNode* ball = [CCBReader load:@"Ball"]; [ball.physicsBody applyForce:force]; [ball.physicsBody ...
1
vote
4answers
2k views

Include Box2D libraries to a cocos2d project (iOS)

I have a problem including box2D to my cocos2d project. I've tried different ways to do it with no success. This is what I've done: I downloaded Box2D (Box2D_v2.2.1) to my project directory. Dragged ...
0
votes
1answer
134 views

Determine speed of sprite

I'm trying to calculate the speed of my sprites in Cocos2d but I'm having some difficulties. I'm not sure which units of time/speed cocos2d uses. My background sprite moves 2 positions to left each ...
0
votes
0answers
60 views

Get Facebook Picture in Cocos2d-iphone V3

I'm trying to get the profile picture from Facebook, but I'm getting the following error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImage ...
0
votes
0answers
136 views

Cocos2D v3 and Physics simulation on server

I'm trying to develop a real time multiplayer game using Cococs2d v3. The game is basically a side scrolling racing game. I wanted to develop the client using Cococs2d for iPhone, and the server side ...
0
votes
0answers
22 views

How to use CCGrid3DActions in Cocos2d-XNA?

For example, I want to add a CCLiquid action to my player shield in my game. In my Player class: public Player() { // code snippet when creating new Player CCSprite shield = new ...
1
vote
1answer
320 views

Cocos2D - Fill a Sprite with a pattern

I have a CCSprite with a certain shape in Cocos2D and I would like to fill it with a pattern, as seen here: I've seen a lot of examples where they fill a rectangle with a pattern, or even a ...
3
votes
0answers
278 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 ...
0
votes
3answers
3k views

How to make game sessions like “with friends” games?

I want to make a game like "words with friends" or "chess with friends" or "Draw Something" or any of the other online multiplayer type games that are based around friends having game sessions with ...
2
votes
2answers
567 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 ...
0
votes
1answer
429 views

Preload in cocos2d v3

I'm trying to create a preload, but i don't know how to implement the code of this topic in cocos2d iphone v3. Since CCTextureCache has changed to CCTexture, and doesn't have sharedTextureCache ...
-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 ...
1
vote
1answer
62 views

Clay Jam continuous path/tap

I saw this game Clay Jam, that the user can create a path in the sand. The path is a continuous one, and it can varies from a single point to curves. How one can develop smooth and continuous paths? ...
0
votes
0answers
114 views

Do SpriteBuilder's Smart Sprite Sheet need to be loaded to memory?

When I create an Smart Sprite Sheet Folder using SpriteBuilder and publish it, must I load that SpriteSheet into memory "FrameCache" with code or does SpriteBuilder do this automatically (so I just ...