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
0answers
7 views
Cocos2dx - How do i predict the movement of object if setVelocity returns different results?
I want to make synchronization movement between client and client.
I've read some posts about simulate physics on the server and predict the movement on the client.
However, how do i do it even if i ...
1
vote
0answers
34 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 iPhone 6 (real device)
The Director::...
0
votes
0answers
24 views
How to get the position of my layer in tiled map?
I'm trying to make a 2D grid in my isometric map, butI want to start my position from my specific layer, no the entire map itself. I can't use the getPosition() or getBoundingBox() since it's ...
0
votes
0answers
16 views
How to create sprite cocos2dx with filling it with texture repeativitely?
I am trying to create recatangular sprite in cocos2dx with texture.
It is retangular sprite, I want to fill it with pixel height texture.
Any way to achive this?
Lets take example of flappy bird:
...
0
votes
0answers
9 views
Cocos2d-JS using Box2D - no contact / collision or bouncing
I'm trying to make a simple Breakout game with Cocos2D-JS, following this tutorial. Since the tutorial is for iOS, I'm doing my best to translate the code into JS.
As I noted here, some of the ...
0
votes
0answers
12 views
Cocos2d-JS using Box2D b2EdgeShape / SetAsEdge crashes
I'm trying to make a simple Breakout game with Cocos2D-JS, following this tutorial here. Unfortunately, said tutorial is for iOS, while I'm doing this in Cocos2d-JS.
Right off the bat I had issues, ...
0
votes
1answer
22 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
77 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
0answers
50 views
How to use joystick in cocos2d-x?
cocos2d-x used GLFW and GLFW support joystick function.
I tried to use it. it does not work on windows, but osx and linux is no problem.
cocos2d-x 3.12 (GLFW 3.2)
windows 10
osx 10.11
ubuntu 16.04
...
1
vote
0answers
31 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
class mainMenu : public Node {
public:
static Scene* createScene();
virtual bool init();
void GoToGameScene(Ref *...
0
votes
0answers
11 views
cocos2dx windows phone bad rendering
I am trying to develop a game with cocos2dx for windows phone 10. But all images quality is too low. I've test with same project on Android and Windows phone 10. When I make a csb file on cocosstudio ...
0
votes
0answers
55 views
Is CocosSharp (from Xamarin) a STABLE and good software tool by now?
Has anyone in this forum ever used CocosSharp (from Xamarin) extensively enough to build a rather complex game ?
Is CocosSharp a good and STABLE software tool by now ?
Do you know if anyone has ...
0
votes
1answer
38 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 ...
0
votes
0answers
29 views
how to use cocos 2d in visual studio 2015 in windows 7
I am trying to start a new project with cocos2d-x tool in visual studio 2015 but I got problem in build the project please help me in installation of cocos2d.
Thanks
1
vote
0answers
26 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 ...
0
votes
0answers
117 views
Cocos2d-x v3.12 compile fails
Question duplicated from Stackoverflow, sorry don't know how to move questions between stack sites.
Recently updated Cocos2d-x to v 3.12 and created the "Hello World!" project but the CLI command ...
1
vote
0answers
20 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
1answer
109 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:
/home/ryan/Downloads/cocos/...
2
votes
1answer
76 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 ...
0
votes
0answers
35 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
15 views
set customize attribute value in a sprite in cocos2d
I want to make a puzzle game by cocos2d ios. For that, I want to set value in customized attribute. Like:
In cocos2d js:(value, power, picked attribute)
var sprite = cc.Sprite.createWithSpriteFrame("...
1
vote
1answer
100 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
80 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 ...
0
votes
0answers
26 views
Compiling 'Hello World' Cocos2D-x Project On Mac
I am trying out Cocos2D-x v3.10, but I am getting a compile error because I am missing an sql 3 library. The specific flag that triggers the error is -llibsql3 in the cocos2D_libs.xcode project. I ...
0
votes
0answers
33 views
How to export cocos2d-x game to Apple store?
I've been making a game for android using cocos2d-x and I made an apk successfully. now I want to upload it to the AppStore what changes should I make?
0
votes
0answers
43 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 ...
1
vote
2answers
57 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
81 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
48 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:
Label::createWithBMFont
also i ...
0
votes
0answers
10 views
cocos2d-x Label Set Custom Direction manually
sorry for my english...
i am using cocos2d-x for developing an android -ios game... can i set custom right-to-left or left-to-right direction to my Label manually? i mean that i want to set it like ...
0
votes
1answer
365 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 ...
1
vote
0answers
47 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
31 views
Cocos2dx : Lua with C++: lua_pcall closing my app
I'll try to explain what is happening with my current project:
I want to make some custom scripts myself without using the lua script engine from cocos2dx, so I linked lua51.lib on Linker->Input, and ...
0
votes
0answers
41 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 ...
0
votes
0answers
32 views
In Cocos-2d-x, is there a way to get a shared OpenGL context for use with background loading
We are using parts of the Cocos-2D-X engine and we have a background loading thread which loads textures in the background. Is there a way to get a ShareGroup so we can safely bind an OpenGL context ...
0
votes
0answers
76 views
How to do serialization in Cocos2d-x?
I can’t find any examples on the web on how to do serialization in nodes. If there isn’t a mechanism already built-in in the engine for this, is there a common pattern used to implement it in Cocos2d-...
0
votes
1answer
142 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. But I don't know how to ...
1
vote
0answers
28 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
88 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
128 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:
CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic("level_music1.wav",true);
On the ...
1
vote
1answer
283 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
116 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
433 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
155 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
40 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 ...
0
votes
1answer
3k 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 ...
2
votes
1answer
670 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 to build the Windows game without ...
1
vote
0answers
43 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 ...
1
vote
0answers
285 views
How to parse HTTP response (JSONdata) in cocos2d-x
I am making a HTTP request to a server and I am getting data from the database. Now I want to parse the JSON data and get the data into variables like this:
std::vector<char> * buffer = ...
1
vote
0answers
22 views
cocos2d-x: Cache draw
I'm drawing a circle using DrawNode.
Is there a way to cache that drawing into Sprite or put it to SpriteFrameCache for later use? Because drawing the circle again each time might slow the game down.