Skip to main content

Questions tagged [cocos2d-x]

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

Build Fails while building for cocos2d-x 3.17 on Ubuntu 22.04

While building the game (cocos2dx- 3.17 on ubuntu 22.04) it fails with below error - ...
user1897165's user avatar
1 vote
1 answer
63 views

Player stays grounded when jumping at the side of a two tile high wall

I am currently developing a simple Super Mario Bros. like platformer in Cocos2d-x v2. I am now at the step of doing wall sliding with two axis-aligned bounding boxes (tiles) but I've not quite found ...
MikaKC's user avatar
  • 11
2 votes
0 answers
63 views

What is the right way to implement a loading screen in cocos2d-js?

We have two scenes that are loaded with heavy computation; a map screen and a puzzle screen. When we change the scene from A to B, the app gets stuck on scene A for a while before it renders scene B. ...
ramiz balayil's user avatar
0 votes
2 answers
475 views

Full-screen window hangs when debug break or crash (Windows/GLFW/Cocos2D)

I run into an issue if my game application becomes unresponsive when running in fullscreen on Windows. This mostly applies when I want to use breakpoints in Visual Studio, however if the application ...
stands2reason's user avatar
0 votes
1 answer
881 views

Cocos Creator - orientation change event in native build for iPhone and Android

I am making some Hybrid app which has some native part in Both iOS and Android and common functionality (which includes and games/animation and UI) which I make in Cocos Creator. The problem I am ...
Balazs Nemeth's user avatar
0 votes
0 answers
31 views

Cocos2dx- how to box2d cannot move through each other?

player box2d ...
Review game's user avatar
0 votes
1 answer
203 views

Resource protection in cocos2d-x 2 and 3

I am developing a game in cocos2d-x 2.2.3 and I want to protect my resources from being extracted. Is there any way I can do this? I don't know much about encryption.
Reza Shafie's user avatar
0 votes
1 answer
458 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 ...
Aniruddha32's user avatar
0 votes
1 answer
336 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 ...
Kevin Mack's user avatar
1 vote
0 answers
614 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 ...
instantaphex's user avatar
1 vote
0 answers
188 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-...
TomSawyer's user avatar
  • 243
0 votes
1 answer
319 views

How can I rotate childrens nodes with parent node in cocos2dx?

Consider the following code... ...
videogamechef's user avatar
1 vote
2 answers
530 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 ...
videogamechef's user avatar
1 vote
2 answers
380 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 ...
videogamechef's user avatar
0 votes
1 answer
378 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 ...
TomSawyer's user avatar
  • 243
7 votes
1 answer
2k 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 ...
Nimesh Chandramaniya's user avatar
1 vote
0 answers
491 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 ...
TomSawyer's user avatar
  • 243
0 votes
1 answer
164 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 ...
RN Vi's user avatar
  • 1
0 votes
1 answer
86 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 ...
user avatar
1 vote
1 answer
157 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 ...
sarada duddela's user avatar
0 votes
2 answers
209 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 ...
Ngọc Anh's user avatar
1 vote
2 answers
308 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 ...
TomSawyer's user avatar
  • 243
0 votes
1 answer
342 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 ...
msmoiz's user avatar
  • 11
0 votes
1 answer
178 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 ...
msmoiz's user avatar
  • 11
0 votes
1 answer
108 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 ...
Lion King's user avatar
  • 171
0 votes
2 answers
848 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 ...
user131012's user avatar
1 vote
0 answers
127 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 ...
x90's user avatar
  • 11
1 vote
0 answers
190 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 ...
sn0wfall's user avatar
0 votes
1 answer
348 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: ...
Ryan Goldstein's user avatar
2 votes
1 answer
920 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 ...
Can Tecim's user avatar
  • 123
1 vote
1 answer
808 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 ...
Dhath's user avatar
  • 11
1 vote
2 answers
396 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 ...
Alexey Elesin's user avatar
1 vote
2 answers
749 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 ...
Mark Ang's user avatar
4 votes
1 answer
162 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 ...
quinnavery's user avatar
0 votes
1 answer
231 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: ...
HadiAbbasi's user avatar
1 vote
0 answers
2k 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 ...
Élodie Petit's user avatar
3 votes
0 answers
89 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 ...
Emadpres's user avatar
  • 940
0 votes
0 answers
122 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, ...
dontangg's user avatar
  • 223
0 votes
1 answer
202 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....
Nya's user avatar
  • 103
1 vote
0 answers
68 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?
looselessOne's user avatar
0 votes
1 answer
201 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->...
Murat Bozdemir's user avatar
0 votes
1 answer
248 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: ...
yossi elimelech's user avatar
1 vote
1 answer
1k 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-...
Monk's user avatar
  • 31
0 votes
1 answer
1k 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 ...
Zoroastiran's user avatar
3 votes
1 answer
1k 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, ...
khofez's user avatar
  • 95
2 votes
2 answers
638 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 ...
y434y's user avatar
  • 123
1 vote
0 answers
51 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 ...
Tushar's user avatar
  • 11
1 vote
1 answer
13k 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 ...
zbarni's user avatar
  • 111
4 votes
1 answer
2k 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 ...
Saturn's user avatar
  • 1,771
1 vote
0 answers
76 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 ...
djserva's user avatar
  • 111

1
2 3 4 5