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

Black border all around simulation / viewport in iOS using Xamarin + CocosSharp

I'm just getting started with Xamarin and CocosSharp so it's possible I've missed something basic here.. but whatever it is I can't seem to figure it out. I'm trying to get my app/game to be ...
0
votes
0answers
7 views

Button is not showing up

private EditText inputName = null; private CCMenuItemImage nextBtn = null; private void init() { CGSize winSize = CCDirector.sharedDirector().winSize(); final float scaleX = ...
1
vote
1answer
31 views

android - How Do I Replace A Scene in Cocos2D

I am using Cocos2D for Android: I have two scenes MainScene and LogoScene. I want to show a Splash screen on LogoScene then, I want to go to MainScene. I am wondering how I can go from LogoScene to ...
1
vote
0answers
13 views

Cocos2d How do I transition to a scene

So I have mainScene and I have LogoScene, I am wondering If i can make logoscene show a logo, then transition to mainscene. here is what i have import org.cocos2d.layers.CCLayer; import org....
0
votes
0answers
14 views

Integrate ImagePicker in Cocos Creator

Can someone please provide steps for integrating this imagepicker https://github.com/qiankanglai/ImagePicker12 in Cocos Creator project ? And please make some tutorials for doing these kind of works. ...
0
votes
0answers
17 views

Instantiate persistent game object?

I wanna making game that is based scenario like Lifeline game. I made everything excluding one thing. I cant save progress in game. My game's logic is instantiate. Player clicks button and texts ...
0
votes
0answers
18 views

Save scene (as prefab)

I wanna save use progress in game. Is to save game possible in cocos2d-js? var wholeScene = cc.director.getScene() // save(wholeScene) Note: I am using Cocos Creator.
0
votes
0answers
24 views

cocos2d c++ Collision between edge physics bodies

I'm working on a game with cocos2d, need to detect collision between two PhysicsEdgeBody. I've created an EventListener for contact and added it to the layer i'm working on, PhysicsContact and ...
0
votes
1answer
37 views

Opengles 2.0, Replace the black region in the image to make it transparent

I have two textures, Source image A and Overlay B, B is drawed on top of A, I want to replace the black color in B, then make the region of A visible, what should I do? This is my shader language: ...
1
vote
0answers
44 views

Cocos2dx Windows Phone 8.1: Seperate Characters in RTL Label

I use below code to show a text : auto label = Label::createWithSystemFont("سلام و خداحافظ", "BTitrBold", 24); ( RTL text like Persian, Arabic and Hebrew) This code works fine in both **Android** ...
0
votes
0answers
37 views

`setVelocity` allows body to pass through bodies

In my game, I'm using cocos2d-x and I wanted to have an object that changes direction immediately, so I used setVelocity() on the physics body to do that. However, when I do that it can run through ...
1
vote
1answer
98 views

Java - Adjusting the speed of an object during movement

I am trying to get an object to move (on java canvas) in the same angle but at different speed within the X and Y axis. Below you can see how i have implemented the movement of the object. xPosition +...
0
votes
1answer
95 views

Unity equivalent to cocos2D (and Sprite Kit) Actions?

Does Unity have an equivalent to the Actions feature/functionality of cocos2D and Sprite Kit; if so, what is it? cocos2D Actions: http://python.cocos2d.org/doc/programming_guide/actions.html http://...
2
votes
2answers
226 views

How do mobile games create simple UI components?

How are simple UI inputs typically handled in 2D mobile games? For example, text input boxes and keyboards. It seems that many game engines do always have simple UI components. There are obvious ...
0
votes
1answer
54 views

Opengles 2.0 multi Textures fade out one by one

I have multi textures, A was drawed on top of B, B was on top of C ...., ( like Picture 1) .I want to fade out A first, then B will appear and fade out either... But when A fade out, background color ...
0
votes
1answer
100 views

Rotate sprite direction Cocos2d

I want that my sprite go always forward, and you can only control his direction moving right and left (on 360 degrees). I don't know why, but the movement it's senseless. The constants to move and ...
1
vote
0answers
113 views

Error OpenGL null Cocos-2D/Visual Studio [closed]

When I try to execute a game code fully functional on Visual Studio 2013, using Cocos-2D (3.8.1) library this error jumps on screen. (I'm working on a laptop) OpenGL 1.5 or higher is required (...
1
vote
0answers
86 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
1answer
127 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 ...
1
vote
0answers
201 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
119 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
230 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
76 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 = _map.objectGroupNamed(...
1
vote
1answer
763 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 ( ...
2
votes
3answers
494 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 ...
-1
votes
2answers
89 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, -visibleSize.height));...
1
vote
1answer
134 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
1k 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 ...
2
votes
2answers
356 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
1answer
77 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
240 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
233 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
101 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
269 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
1k 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
665 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 = PhysicsBody::...
0
votes
1answer
720 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(); director->replaceScene(...
2
votes
1answer
182 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
93 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
718 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
124 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
496 views

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

I've always wondered how the background scene 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
62 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
207 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
111 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
325 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 = CCSprite::...
2
votes
1answer
758 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
76 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
265 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
321 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. ...