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

learn more… | top users | synonyms

1
vote
0answers
48 views

Turn Based Game Match Data in iOS

Hi I’m working on turn based game development using turn based API from Apple’s GameKit framework. My game is 2 player strategy game. Currently I’m facing the issue match data update on game play ...
0
votes
0answers
47 views

Cocos framework gives large Android builds than cocos2d-x

This question is regarding Project Architecture and workflow. I have an installation of cocos2d-x and Cocos Studio with Cocos Framework ( version 3.6). I carried out different build tests with hello ...
0
votes
0answers
178 views

Using Cocos2dx with Android Studio

Has anyone got Android Studio to work with Android Studio? I can get the generated project to work with proj.android, and add the NDK path to local.properties but I can't get it to rebuild after I ...
1
vote
0answers
24 views

Best way to transition between multiple Cocostudio defined scenes

I'm designing a game that has to switch between multiple game scenes. Each scene has been created in cocostudio and is imported into the code as a json file as: var obj = ccs.load(res.Symbols_json); ...
0
votes
1answer
82 views

Transition from UIView to CCScene in Cocos2D

I've surfed the internet for quite some time but haven't come to find an answer. Any help would be greatly appreciated. I am trying to perform a transition from a UIView to a CCScene So i have a class ...
1
vote
1answer
42 views

How to move sprite mimicking mouse/touch position on some part of the screen?

I am having a difficulty and I am been doing it wrong, I think. I want to move sprite relatively to touch. Just like when you are playing space shooter like 1943. I just learning some math and try to ...
-1
votes
1answer
36 views

cocos2d-android collision map

How collision map? I have call: // Get TMX Map and associated layers/groups _map = CCTMXTiledMap.tiledMap("mapdemo.tmx"); _background = _map.layerNamed("Background"); _objects = ...
0
votes
1answer
302 views

How to use Cocos2dJS to connect to a Socket.IO server?

How can I connect to a nodejs socket.io server from a cocos2djs game? I've google all the way to no avail. I tried this but it does not work: socket = io.connect('http://192.168.254.102:7714'); if ( ...
0
votes
0answers
92 views

how to build cocos2d-JS game as a native android app?

I have a cocos2d-JS game which runs in HTML5. How to I build it for android? The part I don't understand is how link cocos2d-JS to cocos2d-x. I know there's JavaScript bindings, but I can't find any ...
2
votes
2answers
173 views

Cocos2d v3.4 Templates

How to create cocos2d v3.4 without using Cocos2D-SpriteBuilder? I installed Cocos2D-SpriteBuilder as they recommended in cocos2d blog: http://cocos2d.spritebuilder.com/get-started But I need to ...
0
votes
0answers
71 views

Cocos2dx How to show different parts of a scene in a split screen

I come from an SFML background and you could show different parts of a scene in split screens by manipulating sf::View. Is there any way to do it with Cocos2dx? I plan to make a split screen game but ...
-1
votes
2answers
74 views

Change sprite position

I have Sprite and i want change my Sprite position when score == 2 score = 0; auto bird = Sprite::create("bird.png"); bird->setPosition(Point(-visibleSize.width, ...
0
votes
0answers
90 views

Show emoji colors in CCLabelTTF in Cocos2D v2.0

Is there a way to show the colors of emoji characters in a CCLabelTTF? As it stands, all my emojis appear monotoned in the color set by the CCLabelTTF. If not, is there an alternative CCLabel I should ...
1
vote
1answer
93 views

How do I calculate the path of something in orbit around one or more bodies?

I need to figure out how to calculate the orbit of an object around one or more bodies for a game that I am making (built on Cocos2D-Swift). The game is in two dimensions, so it's a two-dimensional ...
0
votes
3answers
369 views

How Use loop's in cocos2d-x

I've for loop which work well on Windows double speed = 35; for(int i=0; i<60 ;i++){ speed += 0.3; Sleep (1000); // sleep 1000 mili seonds } But it responds an error ...
1
vote
1answer
157 views

Right-To-Left Text Direction in Cocos2dx

I want to use Persian/Arabic text beside English in whether Label or ui::Text. Persian is a Right-to-Left and English is a Left-to-Right language and so I have problem to combine them in one string. ...
0
votes
0answers
141 views

Cocos2d js database connection from javascript

I have been considering to write a game in cocos2d js, that I wanted to be a turn based multiplayer game. I can't seem to figure out if it is possible with cocos2d js newest version to just add the ...
0
votes
1answer
60 views

differences betwen game resolution in a different display resolution

my game is not supported on the other devices with a different resolutions. for example may character is 140w X 55h pixels which is ok on a 4 inch display but it goes wide when i tested my game on a ...
0
votes
0answers
115 views

Cocos2d v3 - addChild method make performance problems

i have currently a performance problem with the addChild method in cocos2d version 3.3. My scenario is currently that i have about ten CCNode which holds a bundle of other CCNode (about 500), i called ...
1
vote
1answer
127 views

cocos2d-js displays only one type of tile from a tmx file

I am using Tiled to produce a tmx which I use in my code using cocos2d-js. The problem is that when I run it on the browser, a wrong tile gets displayed, the first one of the image (0,0) and repeats ...
0
votes
1answer
69 views

Cocos Code IDE unable to find python

I am trying to create a new JavaScript project on Cocos Code IDE but every time it immediately give me the error message: Unable to find python. Please, click the setting button to set the python ...
1
vote
2answers
129 views

How to prevent fish eye effect when using CCOrbitCamera in Cocos2D?

Note: I'm using CocosSharp, a Xamarin C# version but the question is valid for all Cocos2D versions I presume. I'm also fine with answers in any Cocos2D dialect (there is no tag yet for CocosSharp ...
1
vote
1answer
493 views

How can I run two CCActions in parallel and another one afterwards with Cocos2D?

With Cocos2D I can run two actions in parallel by simply using runAction and I can use a CCSequence two run several actions after each other. However what I could not find is: Run two actions ...
0
votes
2answers
390 views

Cocos2dx - Physics - Abort() When Changing Dynamic PhysicBody to Static?

I just learned cocos2dx v3.3 integrated chipmunk physics engine. Here ,as you see, I create a simple circle with physic as: auto sprite = Sprite::create("circle.png"); auto body = ...
0
votes
1answer
331 views

cocos2dx: RunningScene != Scene You just Replace

I have this code for cocos2d-x 3.x: void MainMenu::StartGame(cocos2d::Ref* pSender) { auto director = Director::getInstance(); auto newScene = Scene::create(); ...
1
vote
1answer
131 views

How can I use CCClippingNode to trim the top and bottom from a CCTableView?

I'm fairly new to Cocos2d and struggling with sizing a CCTableView. How can its height be controlled so that I have space at the top and the bottom? I'm trying to visually wrap the top and bottom of ...
0
votes
0answers
63 views

Using Tile Maps with cocos2d - how do I handle a large amount of images?

I am building a game where the users (players) can build their own town. There they can build houses, add furniture to the houses etc etc. Basically similar to The Sims. I am using the Tiled Map ...
5
votes
1answer
489 views

How to read a color of a pixel from texture (cocos2d-js)?

How to read a color of a pixel at [x,y] from a texture (in cocos2d-js)?
0
votes
0answers
102 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 ...
0
votes
2answers
360 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
53 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 ...
0
votes
1answer
128 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
2answers
105 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
251 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
216 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 = ...
2
votes
1answer
440 views

Why AnchorPoint doesn't affect `CCLayer` Positioning?

I think there is a difference 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 ...
0
votes
0answers
66 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 = ...
-2
votes
1answer
186 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, ...
3
votes
1answer
223 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. ...
1
vote
1answer
275 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
0answers
183 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 ...
1
vote
1answer
1k 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
1answer
542 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 = ...
4
votes
1answer
5k 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
0answers
78 views

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

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 ...
1
vote
1answer
304 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 ...
0
votes
0answers
243 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
1answer
286 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
1answer
192 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. ...
1
vote
1answer
1k 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 ...