Questions tagged [cocos2d-android]

JAVA version for Android development. Cocos2D is an open source framework for building 2D games and graphical applications. Cocos2D-Android and Cocos2D-Android-1 are the two active projects.

Cocos2D for Android is a Java based open source framework for building 2D games and graphical applications. Cocos2D-Android and Cocos2D-Android-1 are the two active projects. The latter is a branch of the former and seems more active.

Both Cocos2D for Android engines are based on the API design of Cocos2D for iPhone, but they are not compatible with each other (Java vs Objective-C).

For more information on the other Cocos2D game engines, see the and tag descriptions.

It is recommended to use the following tags appropriately:

  • Use the tag on questions referring to the Objective-C based framework
  • Use the tag on questions referring to the C++ based cross-platform framework
  • Use the tag on questions referring to the JavaScript based framework
  • Use the tag on questions referring to the Java based frameworks
  • Use the tag on questions referring to the Python based framework
  • Don't use any of the above tags together in the same question, unless your question refers to more than one Cocos2D engine. For example, if you ask "How to port from Cocos2d-iPhone to Cocos2D-x?" you should include both and tags.
398 questions
0
votes
0 answers

Cocos2D Android app crash

I'm developing Cocos2D android app, this is my 1st sample application. cocos2d-android.jar I downloaded and attached it in /libs folder. Here is my classActivity & logcat output CocosMainActivity : CCGLSurfaceView mGLSurfaceView; …
Saj
  • 849
  • 7
  • 12
0
votes
1 answer

Cocos2d-android How to load TMX tiledmap

I'm developing a game on Eclipse. Im using Java language. The game needs to load .tmx files. I don't know if my codes are correct. CCSprite bgtitle; CGSize winSize = CCDirector.sharedDirector().displaySize(); protected CCTMXTiledMap…
0
votes
2 answers

Cocos2d-android detecting randomly created sprites or rects

I am developing an android game on Eclipse in which a sprite is jumping on several platforms to get to the top but I am having difficulties. Here is my case: I have the character sprite (I'll name this as Sprite1 in this case) that moves and I am…
0
votes
1 answer

Cocos2d-android detecting bounding box of sprite

Is it possible to detect collisions with certain parts of a sprite's bounding box? For example if a sprite jumps and landed into a platform, the bottom part of the sprite bounding box's and the top part of the platform bounding box's collision will…
0
votes
0 answers

How to move a Sprite along a definite path in Cocos2d using Android(SDK)

I am working on a 2d game. I am using cocos2d with android SDK. I want to move my sprite along a definite path. I am using for that the code below, but I dont get anything in the output. target = CCSprite.sprite("plane1n.png"); CGPoint…
0
votes
2 answers

How to move spirte by touch android app cocos2d

i want to move a sprite by touching on screen, i want the sprite to move to the place which I touched. i have implemented a code but it crashes, i want to move a sprite by touching the screen to that point but my app crashes. public class GameLayer…
0
votes
1 answer

Error Message when Trying to Run the Sample Cocos-2DX Android Project on Eclipse

After following the directions on the Cocos-2DX site to get the android environment set up, I'm coming across this issue when trying the run the project as an Android application [2013-12-03 22:12:10 - HelloCpp] Unable to resolve target…
NinjaCode
  • 79
  • 1
  • 2
  • 8
0
votes
2 answers

Cocos2dx - play frame animation forever, but pause for a few second before the repeat

I am trying to play a frame animation sequence looping forever, but after each play, I'd like to delay for a period of time before the next loop. Here's the specific code: CCActionInterval *pAnimate = CCAnimate::create( m_pAnimationDebugSkill…
Zennichimaro
  • 5,236
  • 6
  • 54
  • 78
0
votes
2 answers

How to check CCString is empty

I am using cocos2d-x and I want to check that CCString is empty or not. Since I am using box2d where i have to get fixture user data as ccsting from and check it is null or empty.
Singhak
  • 8,508
  • 2
  • 31
  • 34
0
votes
1 answer

Convert a maze png to actual playable maze in cocos2dx

I am developing a game in cocos2dx, I have a sprite of a maze, in png format (with walls and other areas are transparent). I was wondering if there is any way I can detect collisions with these walls in the sprite. The player will drag an object…
Wajahat
  • 1,593
  • 3
  • 20
  • 47
0
votes
1 answer

Send to the Google Play and come back from there got black screen?

I have a CCScene, In the CCScene there is button "More Apps / rate App". When I tapped on, It'll take me to the play store and when I press the back button I got the black screen but What is open that time "CCScene which have the button "More Apps…
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
0
votes
2 answers

CCSprite gives the unpredictable result?

I am using the Cocos2d-android library Qus : Image what I call from CCSprite.sprite("Star.png") , Sometime Appear correctly or Sometime randomly pick an Image from asset foler ? Basically I am follow the Sample example which is in the library of…
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
0
votes
1 answer

Scroll CCLayer horizontally in cocos 2d in Android

I am Working Android game using cocos 2d. I have Main Activity and Layers added on Main Activity in my Layer. I have 5 sprites and I have to use scroll view to scroll all sprites horizontally so user and perform further task on each sprite but I am…
Arun Thakur
  • 55
  • 10
0
votes
4 answers

How to add ScrollView in Android cocos 2d?

I am Working on Android cocos 2d and i have 8-10 CCSprites which has to scroll horizontally by click of each sprite their is next CCLayer to load so need to Add ScrollView in CCLayer but i am not getting how to do this i am using …
Arun Thakur
  • 55
  • 10
0
votes
1 answer

Android with Tiled tmx and cocos 2d renders corrupted images

I'm trying to show a map created with Tiled map editor using Cocos2d in an android game, but all tiles get corrupted I cannot add the image 'cause I don't have the reputation to do so. Do you have any idea why this is happening and how to solve this…