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
3
votes
3 answers

Cocos2d Android Lock Screen or Leaving Game Forces Restart

I am in the final stages of a Cocos2d - Android game and I am having a problem that I can't figure out. When I lock my tablet (Nexus 7) or when I hit the home button to leave the game, it restarts. It goes right back to the splash screen like the…
Atamous
  • 41
  • 3
3
votes
2 answers

ccTouchesBegan is not working in cocos2d-android

I enabled setIsTouchEnabled(true); but i cant able to detect the touch begin and touch end in cocos2d-android. my gamelayer is public class GameLayer extends CCColorLayer { protected CCLabel _label; public static CCScene scene() { …
Gajini
  • 413
  • 1
  • 5
  • 21
3
votes
1 answer

How to find the whether the sprite is collide with the other sprite in cocos2d-android?

I have searched alot in order to make the sprite(_player) detected and collide with the other sprite(target) and being removed after the collision through out google and stackoverflow site, but could not get the solution in cocos2d-android, i'm able…
DD.
  • 973
  • 2
  • 10
  • 32
3
votes
0 answers

CCTMXTiledMap not showing on Android screen

I'm adding a CCTMXTiledMap to my Android project but it's not showing on the screen. This is what I tried. I created the map with Tiled, changed the compression in Base64 gzip to get rid of the indexOutOfBounds issue, and loading it with this…
Eddy
  • 3,533
  • 13
  • 59
  • 89
3
votes
2 answers

how to design android cocos2d app for multiple screens

I am working on Cocos2d Android,in cocos2d images are saved in assets folder, here we can't take images ldpi,hdipi,mdpi images. So which size images are best for supporting multiple devices(phones and tablets). I have taken small size…
3
votes
3 answers

How to use getAssets in a class that extends CCLayer

I have a class that extends CCLayer. I have to get a text file from assets folder. But i couldn't use getAssets() in this class. How can i use getAssets() in a class that extends CCLayer???
Deepzz
  • 4,573
  • 1
  • 28
  • 52
3
votes
2 answers

Max image size on Android device

I am porting an existing game from iOS to Android, and would like to know if there's a size limit for PNG images? On old iOS devices, the texture atlas size cannot exceed 1024 x 1024 pixels. Does a similar limitation exist for Android…
tomas
  • 91
  • 1
  • 7
3
votes
1 answer

Collision is not working properly in Box2D with Cocos2d Android

The beginContact callback function is being called for the bodies that are not colliding. I have many bodies on the screen, all are far away from each other, but suddenly collision occurs and contact listener starts returning all the bodies on the…
Jawad Amjad
  • 2,532
  • 2
  • 29
  • 59
3
votes
1 answer

Linux and cocos2d: 'cc1plus': execvp: No such file or directory

I am trying to build a cocos2d sample app for android on linux and i get the following error: stefanos@stefanos-MS-7250:~/cocos2d-1.0.1-x-0.11.0/Test1/android$ ./build_native.sh make: Entering directory…
SteveL
  • 3,331
  • 4
  • 32
  • 57
3
votes
1 answer

Difference between BezierBy and BezierTo in Cocos2d?

I Want to know the difference between the BezierBy and BezierTo. What will happen in the below code if say this is the scenario CCBezierConfig bezier = new CCBezierConfig(); // Bezier curve bezier.controlPoint_1 =…
user1169079
  • 3,053
  • 5
  • 42
  • 71
3
votes
1 answer

Cocos 2D NullPointer Exception

I followed the guide in the following tutorial. http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/ right on the first run i got the following error. 04-29 10:21:08.022: E/AndroidRuntime(12702): FATAL EXCEPTION: GLThread…
Vishnu Mohan G
  • 622
  • 1
  • 7
  • 14
2
votes
1 answer

how to use CCJumpTo in cocos2d-android

I am new to cocos2d-android. I want to add CCJumpTo using touch event in my code. But I don't know how to fix it. plz help.
Zahidul
  • 389
  • 5
  • 15
2
votes
2 answers

Repeating parallax using Cocos2D on Android

I want to draw a infinitely repeating parallax using Cocos2D on Android. Now, there are some solutions given to this problem in Objective C, but I'm stuck with my implementation in Android. I have tried using CCSprite background =…
Saurabh Verma
  • 6,328
  • 12
  • 52
  • 84
2
votes
1 answer

Add EditText in android using cocos2d-android

I am developing in cocos2d-android. I am facing a problem with integrating EditText in a CCScene. Please help me to solve this problem.
Anindya
  • 65
  • 1
  • 9
2
votes
1 answer

Cocos 2D How to scale down image?

I have an image I'm trying to use as a background in Android. The image is tablet sized, but I'd like it to scale down when there is a smaller screen. I know the aspect ratio might be off. In any case, here is my code: CGSize winSize =…
spentak
  • 4,627
  • 15
  • 62
  • 90