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
2 views
cocos2d-x .. How to detect which sprites are underneath a touch event
I was wondering what the best solution is in the following scenario:
Lots of sprites floating around on screen.
A user can touch one sprite and drag to another sprite.
Throughout this entire time, I ...
1
vote
0answers
7 views
Why AnchorPoint doesn't affect `CCLayer` Positioning?
I think there is a different 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
34 views
Comparing Wi-Fi and mobile sensors data [closed]
I'm responsible for a game development and I decided to go for cross-platform and use cocos2d-x (or else).
I have a 2D game in early development which basically compares 2 streams of data. The game ...
0
votes
0answers
20 views
Import JSON from CocosStudio to 2dx?
I'm new to Cocos2d and trying to figure out how to use CocosStudio v1.5 for animation along with learning Cocos2dx . I'm hoping to put all the animation for one character on one sprite sheet and one ...
0
votes
0answers
35 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, ...
-1
votes
0answers
28 views
How to fill a sprite with a pattern image in Cocos2D-X v3?
I'm searching for a solution on how to fill a sprite with a pattern image.
I have searched on google and many websites/forums but I've only found solutions for Cocos2d not Cocos2d-x v3.
Many thanks ...
2
votes
1answer
58 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
48 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
14 views
Animate a tile in coco2d-x
I am trying to animate a tile in my tile-based game using coco2d-x 3.0
I am using tileAt(ccp(x, y)) to retrieve my tile Sprite been when I am trying to apply animation an assert is jumping with : ...
1
vote
1answer
55 views
Box2d - Attaching a fired arrow to a moving enemy
I am firing an arrow from the player to moving enemies. When the arrow hits the enemy, I want it to attach exactly where it hit and cause the enemy (a square) to tumble to the ground. Excluding the ...
0
votes
0answers
31 views
Cocos2dx InApp Purchase for ios
I am trying to integrate In App Purchases in my app made by using cocos2d x c++. I am using easyNdk Helper for In App Purchases. My In App Purchases works perfectly for my Objective C apps. But for ...
1
vote
1answer
81 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
40 views
Cocos2d-x v3.1 for WinPhone 8 auto change texture after resumed from background
I have some sprites in my game (for Windows Phone 8). These are my steps to reproduce the problem:
Open game
Play (this is an optional step)
Press Windows button to send game to background
Press ...
1
vote
0answers
70 views
Weird y offset when using custom frag shader (Cocos2d-x)
I'm trying to mask a sprite so I wrote a simple fragment shader that renders only the pixels that are not hidden under another texture (the mask). The problem is that it seems my texture has its ...
0
votes
1answer
58 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 = ...
1
vote
1answer
123 views
How to prevent showing outside of Game Map ( Cocos2D-x ) ( Scrolling game )
I'm trying to make a tower defense game and it can zoom in/out and scrolling over my world map. How to scroll over the game and how to restrict it not to show outside of my map(black area).
At below ...
0
votes
1answer
178 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
131 views
How to make glow effect in cocos2dx
i searching the web for glowing effect , i like to be able to create misc glowing effects ,
like lasers , glow around sprites and such .
couldn't find any thing on the web , any body have any ...
1
vote
1answer
103 views
Issue porting Cocos2d-x to Android
I've written a basic game using Cocos2D-x on XCode. It works fine on the iPhone. Now I'm trying to port it to Android. When I run the script ./build_native.sh
inside the proj.android folder, it gives ...
-1
votes
1answer
59 views
in-app purchase in cocosSd-x 3.0
I am working within a team, and we're at the point of finishing our first cocos2d-x c++ application.
We want to add in-app purchases. for what, we made a search for this. We found 2 solutions:
1- ...
0
votes
0answers
41 views
What aspect ratios and resolutions should my mobile game target? [duplicate]
I used cocos2d-x to create a game. How do I need to set up the art so it works on different devices? How many aspect ratios and resolutions should I slice the same image to have it look good on iOS ...
0
votes
1answer
107 views
Cocos2d-x 3.0 animation frame by frame
As I know animations are actions. Now I need to play animation frame by frame. Say I have an animation from N frames. each frame should be played after t delay. Now I want to play animation frame by ...
0
votes
0answers
104 views
Require game logic like temple run
I am new at game development but I have done some work in cocos2dx for iphone.
I am interested to develop a game like temple run.
I read that temple run is 2D game feel like 3D but I believe that I ...
0
votes
0answers
52 views
What's the equivalent of UIBezierPath in Cocos2d-x?
I'm beginner in Cocos2d-x , and i want to implement this tutorial with Cocos2d-x v.3 cpp, but the problem i dont know if there's UIBezierPath in cocos2d-x.
Could you help me to draw the Bezier Arrow ...
0
votes
1answer
183 views
using eclipse instead of visual studio for cocos2d-x project
im using coco2d-x v 3.0 i made a new windows project to test it and it is working but when i try to build and run a project using this command cocos run -p win32
it is print this error
it seem ...
0
votes
1answer
102 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
0answers
172 views
Cocos2d-x , setup the debug environment and remove the red marks in my eclipse
I am struggling with this issue since last week.
I still can’t figure out where is the error.
My code is compiling perfect if I restart the eclipse. but, when I edit the c++ file it shows red marks ...
0
votes
0answers
51 views
Trying to make a mouseJoint with Box2D on Cocos2D-X
I'm trying to obtain this result:
http://appcodingeasy.com/Gideros-Mobile/Dragging-Box2d-object-in-Gideros-Mobile (there's a video - YouTube).
But I'm missing something, because if I follow the code ...
1
vote
2answers
213 views
Best logic to create and drop new gems in a Match-3 game
In a simple match-3 game, with a square gems matrix creating and dropping new gems is fairly simple: when needed I generate those gems above the matrix and then I make them fall into the main matrix ...
1
vote
2answers
227 views
How do I separate testable game logic from my UI in Cocos2d-x?
I read some articles on why I should separate game logic and UI code: That makes it possible to test game logic code can be independently of the rest. However, I am having trouble implementing this in ...
0
votes
1answer
56 views
Changes to myApp.js files are reverted back to normal when the project is build - Cocos2dx
I am trying to do some changes to my myApp.js file of coco2dx project for android in eclipse but I am not able to do it.
I am actually trying to change the default background image of my app. But ...
0
votes
0answers
72 views
cocos2d-html5 & cocos2d-js compatibility
Currently we are shifting towards html5 dev for a few customers and I'm wondering how compatible are the 2 javascript versions of cocos2dx (cocos2d-html5 & cocos2d-x with javascript bindings).
...
-1
votes
1answer
230 views
Tower Defense Search Enemies Efficiently
I had a problem with the build of a TD.
I got a slow - non efficient search for towers find targets to shoot.
PD: enemies[] got all the active & non-active enemies (death and alive) ->Im using ...
0
votes
1answer
366 views
How do you create 2D skeletal animations without extra software? [closed]
I'm working on a Cocos2d-x game and I'm developing on Windows. What I want is to make some skeletal animations, without using a tool or extra software to do so?
0
votes
1answer
133 views
translate-scroll repeated 2d texture using opengl shader
I managed to implement an infinite 2d texture scrolling using the following shader. btw I'm using cocos2d-x 2.2.1.
The vertex shader:
attribute vec4 a_position;
attribute vec2 a_texCoord;
#ifdef ...
0
votes
0answers
165 views
box2d's ApplyForce works wrong after cocos2d-x's replaceScene
i'm practicing making a breakout game, using cocos2d-x 3.x and box2d, referencing here.
i create a ball in the scene's init function and apply force.
when ball hits bottom wall, if i touch screen ...
1
vote
2answers
246 views
How can I list files in a folder from JavaScript in cocos2d-x?
I need to list all the files in the res folder from a JavaScript script in cocos2d-x. What would be the most efficient way to do this?
To keep compatibility with Cocos2d-html5 a JavaScript-only ...
1
vote
1answer
473 views
Create tile map in Cocos2D-X by not using TMX file
I used to make a tile base game in Windows with my own tile map file, but it is a static tile map. I use an 2D array to store of my tile map. Now I want to make game in smartphone by using Cocos2D-X, ...
0
votes
1answer
211 views
Should I drawing directly on CCLayer or CCSprite?
Now I am a little confused in my cocos2d-x cpp project. I want to draw lines with user's finger touch. Following the screenshot of a CCScene:
In the screen, there are two squares. I want show an ...
-1
votes
1answer
103 views
Collision function calls before colliding
My Box2D contact listener class is calling post solve and beginning the contact function before colliding? This is causing my object to bounce back before hitting the ground. What could be causing ...
1
vote
2answers
247 views
How to find collision detection side between two objects?
I am using box2D and I have two objects, one is bouncy ball and the other one is block. I'd like to find which side of the block is collided with, so I can only make the ball bounce when it hits the ...
0
votes
0answers
233 views
Design virtual resolution for 2D development in Unity
I came to Unity with Cocos2D-X experience in mind.
In Cocos2D-X, I can choose a "virtual" screen resolution size to rely on the entire game during development and the game will automatically adapt to ...
0
votes
1answer
248 views
cocos2dx- set draw() method interval time
What is the default interval of draw method call in cocos2dx engine? Can we set it manually? I couldn't find much information about it online. After researching a bit I found that update() method ...
0
votes
2answers
192 views
Implementing `fling` logic without pan gesture recognizers
So I am trying to port over a simple game that I originally wrote to iphone into cocos2d-x. I've hit a minor bump however in implementing simple 'fling' logic I had in the iphone version that is ...
0
votes
0answers
422 views
Cocos2dx- Draw primitives(polygons) on Update
In my game I'm trying to draw polygons on on each step i.e. update method. I call draw() method to draw new polygon with dynamic vertices. Following is my code:
void HelloWorld::draw ()
{
...
1
vote
0answers
345 views
Cocos2d-x CCFollow Zooming issue
Hi I am currently building a cocos2d-x game which incorporates pinch zoom using CCLayerPanZoom class which can be found here
The problem is basically when using CCFollow and zooming and out, it ...
1
vote
1answer
287 views
Limiting the speed of a dragged sprite in Cocos2dx
I am trying to drag a row of sprites using ccTouchesMoved. By that I mean that there is a row of sprites (they are colored squares) lined up next to each other and if I grab one with a touch the rest ...
0
votes
0answers
92 views
cocos2dx and tweenings libs
I know cocos2dx has built-in actions like move-to, etc... to do some kind of tweening but haven't seen any way for example to add different easy ins and outs. Browsing the documentation haven't found ...
1
vote
1answer
290 views
Project location to perspective fake 3D view
I am trying to implement a perspective view in a 2D soccer game, such like Nintendo World Cup. In this case, the soccer pitch will look like a isosceles trapezoid, but not a rectangle in real.
Here ...
1
vote
0answers
532 views
Parallax Scrolling Road-2D [duplicate]
I'm working on a racing game which will have a top view from the back camera. The image below displays a similar example. I am confused about how to achieve the movement of the road if parallax ...