Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

cocos2d-x is a cross plaform port of cocos2d-iphone using C++. It supports iOS, Mac, Android, Samsung Bada, BlackBerry Tablet OS, Windows and Linux. It has built-in bindings for Lua and Javascript.

0
votes
1answer
25 views

Circle to Circle Collision of moving Sprites

i needed help attaching circle1 Sprite to circle2 Sprite on collision onto the same point where they are getting collided, and both circles are moving with Action. Like this, Attaching means, when ...
0
votes
0answers
12 views

Cocos2dx Follow action is not working

I am making a 2D platformer game and I want my camera to move with the player sprite. There's a Follow action in cocos2dx which I used but Its not moving the scene as expected. Please take a look at ...
0
votes
0answers
33 views

Undefine symbols for architecture x86_64 ( cocos2d-x samples for the Firebase C++ SDK)

I am working a cocos2dx project and trying to integrate Firebase C++ SDK in my project as below. I have been following the instruction from Firebase Cocos2d-x Samples in github provided by Google ...
0
votes
0answers
15 views

How to get libCocosDenshion.a to compile for x86_84?

How do I compile libCocosDenshion.a for x86_64 targets on iOS? I've got the main libCocos2d static library but I can't find any information on libCocosDenshion.a. The fle I have works fine when not ...
0
votes
1answer
69 views

Assets from Tiled background layer not appearing in Cocos2d-x

I'm running into an issue with a Tiled map used as a background image for a scrolling scene. I'm using two sprite sheets to provide assets for a background layer. In Tiled, all of these assets appear ...
1
vote
0answers
146 views

Correct way to move player in cocos2d-x chipmunk platformer

I'm attempting to make a physics based 2d platformer in cocos2d-x using the built in chipmunk physics engine. I've not used a physics engine before and I'm having some issues setting the correct ...
1
vote
0answers
47 views

Cocos2d-x : Socket.io-client-cpp crashes after creating scene

I'm using https://github.com/socketio/socket.io-client-cpp with cocos, because the built-in socket.io doesn't support callback (http://discuss.cocos2d-x.org/t/doesnt-work-with-socketio-2-0-1-and-...
0
votes
0answers
64 views

Game monetization code architecture

I am developing a game using a game engine. I want to build a monetization system for my game. The monetization system will provide 2 options to the user: Upgrade their power-ups Purchase in-game ...
0
votes
0answers
74 views

In-app purchases plugin for Cocos2D-X

I am planning to use In-App Purchases plugin from SDKBOX for my 2D game developed in Cocos2D-X. I read about this plugin and features described here (http://www.sdkbox.com/plugins/iap) looks promising....
0
votes
0answers
226 views

Load Cocos Creator Scene in Cocos2d-x

I'm using JavaScript in Cocos2d-x, and I can't figure out how to load a Cocos Creator scene (*.fire which looks like JSON data) into a variable which I'd like to ...
0
votes
0answers
32 views

How to update Cocos2D in an outdated ios app?

Is there a way to update an old version of cocos2d to be in latest version or the version 2.2.6 that supports 64bit ios?
0
votes
1answer
58 views
0
votes
2answers
133 views

Can I create custom framebuffer and render to it in cocos2dx?

I want to do post processing effects so I was thinking If I could just make custom framebuffer in cocos2dx like OpenGL and render the ALL SCENES objects in it. I want a single frame buffer for all ...
0
votes
1answer
49 views

How to keep same aspect ratio in different devices with cocos2dx?

I have been making a board game and I am using cocos2dx. There are two scenes for now, One is main menu and the other is gameplay scene. When I run the apk on tablet with EXACT_FIT resolution policy ...
0
votes
1answer
111 views

Cocos2d-x setContentSize, setScale give poor graphic quality

I want to create sprite with size is relative to the screen size. I.e: Sprite size is equal to screen width * 0.2. I use setContentSize and ...
5
votes
1answer
424 views

Train-like movement in a 2D game

I am developing a 2D game using Cocos2d-X in C++ language. In my game, I need to implement train movement. Here is the image about the output I want to achieve: I tried to do the above moment using ...
1
vote
0answers
126 views

Cocos2d-x: Differences between applying shader to child node and entire scene?

I'm beginning with shader. I wonder what if i apply shader for single node, what'll happen? The gl_FragCoord = (0.5,0.5) is the bottom left of the screen or the ...
0
votes
1answer
90 views

Cocosdenshion and Android not working

I'm trying to play sounds and music with cocos2d. When I run on iPhone and .caf files the audio is perfect, but on Android it is not playing the background music and is only playing 2 sounds of 10 ...
0
votes
1answer
61 views

Cocos2dx launcher - how do I set a newer engine version?

Why doesn't Cocos(V3.10) detect my newer engine version (3.14) which I downloaded and placed into the engine folder? ( I mean the launcher, the all-in-one version where you can create your project ...
1
vote
1answer
115 views

how to make a ball move in opposite direction when hitter to ball or paddle

I had set angle but it's not correct and I'm not getting exactly what I needed. The ball should bounce when hit to paddle or border and move in opposite direction. I'm writing the code in c++. I had ...
1
vote
2answers
95 views

What does glBlendFunc do when given an incorrect enumeration value?

In cocos2d-x, I am using particle system from plist with blend values: dst = 1, and src = 100 which is wrong enum for gl_blend. Although app logged "OpenGL error 0x0500" but it still run and showed a ...
1
vote
2answers
178 views

Get different result on different devices (same resolution) after setVelocity

I'm dying with physics , i've tried to use setVelocity however i got slightly different value from different devices. I've tested on iPhone 5 (on simulator) and ...
0
votes
1answer
153 views

How to detect collision during a cocos2d::Action

I spent a day trying to hack my own Action class, but given the hurdles I've hit trying to do so, I'm hoping there's some way to work around my problem while still using the built-in (and admittedly ...
0
votes
1answer
134 views

How should you structure your graphics system around your logic system?

C++ & Cocos2d-x, but I think the issue is language-independent. I just recently finished up writing the foundational logic for my game. The way I've decided to keep my logic and my graphics ...
0
votes
1answer
71 views

Why the layer must be created from my class and not from layer class

I am confused about something. I have the following example: mainMenu.h ...
0
votes
2answers
260 views

Cutting up a Sprite sheet to frames

I'm new to game development, so please be kind if this is a very simple question. I have a Sprite sheet with 18 frames of the same character (6 col x 3 rows) moving slightly. I want to get the frames ...
1
vote
0answers
98 views

Cocos2dx v3 Problem with moving Sprite on tilemap after it was scrolled up

I have a problem I can't solve so far. I have a scene with tile map on it. And there is a Sprite spawnpoint on map. This Sprite should do MoveTo() action to the point where TouchEnded(). It all works ...
1
vote
0answers
68 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 ...
0
votes
1answer
234 views

Cocos2d-x build failing on linux

I was trying to compile cocos2d-x on my linux machine, because they do not provide a binary copy of the library. However, I received the following error during the build: ...
2
votes
1answer
264 views

I need to find intersection point of a vector in an axis aligned rectangle

I need some help, I have one vector in a rectangle like following (Ops, first A2 point on the top should be A1, assume it is A1) Let's say the vector is like above It doesn't have intersection point ...
1
vote
1answer
417 views

Shooting Projectiles

I am using cocos2D-x and am trying to achieve the effect of enemies going past and shooting projectiles at the player who is moving around the screen. I am using the code below, which is based on this ...
1
vote
2answers
232 views

How to program friction in an air hockey game in Cocos2d-x 3.11?

I'm developing a simple air hockey game, and I have a question about friction of puck and puddles with the game scene. How can I do that? I'm using cocos2d-x default physics engine, and the friction ...
1
vote
2answers
337 views

Cocos2d: Tweening primitive data-types

I asked in SO, but no responses so I'm posting here since it's probably more relevant here. EDIT: SO question closed. I'm trying to tween primitive data-types the way Action tweens position to ...
3
votes
1answer
114 views

How to make expanding ring with constant thickness?

I need to generate this burst or (donut-shaped) pulse. I'm having a difficult time how to generate such shape. At first, I was thinking of scaling the image but that didnt work out because the line or ...
0
votes
1answer
159 views

cocos2d-x Label Load Image like Sticker-Smile..(by html or …)

hi and sorry for my english... i am using cocos2d-x (c++)... can i load sticker (smile) in my Label(a text mixed by image)? i know that we can load bitmap fonts by: ...
0
votes
1answer
1k views

How to connect to a socket.io server from a Cocos2d-x game?

The question can also be asked more specifically as; How do I connect to a socket.io server with C++ from a mobile game? I am aware of Boost (and Socket.io C++ client libraries using Boost) but ...
2
votes
0answers
69 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 ...
0
votes
0answers
78 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, ...
0
votes
1answer
162 views

How can I save and load an adventure game?

I'm using cocos2dx and sqlite to store datum. The table looks like this: x INT, y INT, className TEXT, properties TEXT. I use json to serialize terrains and sprites....
1
vote
0answers
54 views

Can I use sdl_net2.0 with cocos2d-x? [closed]

Can I use sdl_net2.0 lib with cocos2d-x? And how it cconects to each other. Or analog lib to use?
0
votes
1answer
128 views

how to naturally rotate a ball according to its velocity on a surface, a wall

I develop a game on cocos2d-x cpp. There is a ball sprite in my game. I move the ball on a surface(wall) via touch events but it can't naturally rotate according to its velocity. if i use ballSprite->...
0
votes
1answer
217 views

Cocos2d background sound not playing a second time C++

I'm using cocos2d-x on windows10 UWP project. I use the SimpleAudioEngine to load the music: ...
1
vote
1answer
719 views

What is CC_Time in cocos2dx?

I was following this tutorial to understand using custom shaders : http://www.cocos2d-x.org/wiki/User_Tutorial-Realistic_looking_animated_real-time_clouds I understand that CC_Time is Cocos2d-x built-...
0
votes
1answer
510 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 ...
3
votes
1answer
951 views

Cocos2d Sprite 3D position

When I set a position3D for a Sprite in cocos2dx, it render two times the same sprite, i took a screenshot: I set the position3D because i want to use the Z position the give an effect of distance, ...
2
votes
2answers
476 views

How to handle sounds muting in settings?

I have a easy and specific question. Let's say that in my game I use singleton for playing/pausing/changing volume of specific sounds (SimpleAudioEngine in cocos2d-x). What is the best way to ...
1
vote
0answers
48 views

Black bar in beetween the image when Background move infinite

I'm trying to scroll my background forever and so I'm using the background image twice. When the first one goes off screen, it should relocate to the end of the second one. However, there seems to be ...
1
vote
1answer
9k views

How to set up Cocos2d-x for visual studio?

I want to make a cocos2d-x game. I read you can use any IDE, so I was planning to use Microsoft Visual Studio 2015, since I want to make my game primarily for Windows. I have been searching for ...
4
votes
1answer
1k views

Compile cocos2d-x Windows games without Visual Studio

I want to use cocos2d-x to make a Windows game. I used the cocos console: cocos compile -p WIN32 And apparently it needs Visual Studio. Is there an alternative ...
1
vote
0answers
59 views

Cross-platform game to be wrapped into a native iOS/Android app

I need to build an app like Lumosity (https://play.google.com/store/apps/details?id=com.lumoslabs.lumosity) that is native app and have some game screens. So the question is: Is there a way to build ...