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
1
vote
0 answers

Error To Run Cocos2d-X sample Android Application?

I'm new in Coco2d-x for android . I've configured everything to run cocos2d-x applicaion. But still showing one error when I'm running the application. The error message is given bellow. (skipping file '.gitignore' due to ANDROID_AAPT_IGNORE pattern…
TKumar
  • 818
  • 2
  • 10
  • 35
1
vote
0 answers

How to add rect to every sprite which is on screen. cocos2d android

I am Creating a game where the cars move on the screen. The cars are generated from 4 sides of the screen moving to the opposite side of the screen. When I touch a car , the car should move at another speed. I Implemented everything but I am stuck…
Sandeep R
  • 2,284
  • 3
  • 25
  • 51
1
vote
1 answer

How to pass parameters through CCCallFuncND in Android

How to pass the parameters through CCCallFuncND. I want to pass one int value. my code is: int val= 6; CCCallFuncND.action(this, "jumpUpAnimation", val); and the method is public void jumpUpAnimation(int index) { System.out.println("index is…
Hari Babu
  • 891
  • 1
  • 9
  • 22
1
vote
1 answer

Android - admob + cocos2d

I would like to know, how can I add a admob banner in cocos2d view? This is my class public class TitleScreen extends CCLayer{ private ScreenBackground background; private ScreenBackground background2; /** * Intância do Player */ private…
Jhonatan G.
  • 97
  • 1
  • 3
  • 11
1
vote
2 answers

Cocos2d-Android - What is the difference between Sprite.getcontentsize , Sprite.getscale , Sprite.gettexture

The Title says it all. I want to know what is the difference between Sprite.getcontentsize, Sprite.gettexture , Sprite.getscale. and How are they used. I couldn't find any resources following this question.
Sandeep R
  • 2,284
  • 3
  • 25
  • 51
1
vote
1 answer

Can't find the file "create-multi-platform-projects.py"

I downloaded the sdk (3.0a1). According to cocos2d-x guide, I have to run the create-multi-platform-projects.py command in order to create a project, but the script doesn't exist in the package I have downloaded. The guide says Note: These…
1
vote
2 answers

Cocos2d image animation not being repeatad

This is a code which I used for animation in cocos2d android, but it doesn't repeat, what to do for that? public void animWaterSplash() { OpenPuzzleAnim = CCAnimation.animation("", 0.18f); for (int i = 1; i < 3; i++) { …
1
vote
2 answers

How to get back to the previous CCScene?

I have one CCScene, in which their is About us ICON. When I tap on it, goes to the next CCScene where the information to display. Now, what happen When I touch on the back option of the android phone, Game closed. what I need when I click the back,…
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
1
vote
1 answer

Masking sprites in cocos2d for android

I want to develop a game like jigsaw where the player will attach pieces of puzzle to match to a sprite.For this I've figured out to do Masking. I even found one class in cocos2d for iphone named CCMask that does this task pretty well. However when…
Parvaz Bhaskar
  • 1,367
  • 9
  • 29
1
vote
1 answer

automatically Application close when in apps dialog open in cocos2d android

i am trying implement in apps purchase in cocos2d game. i use extend CCLayer scene() in cocos2d. when i click on button of in-apps purchase than payment dialog is open but my application is close in back-end. i don't know how this happen.
1
vote
1 answer

CCSprite comes and after 3 sec it'll remove automatically ?[Done]

I am working on project with cocos2d-android. What I need this time is : A CCSprite comes on the screen and stay 3-4 sec and remove automatically. What class is available to do this work If anybody have done this thing earlier. Suggest me the way ?
Akarsh M
  • 1,629
  • 2
  • 24
  • 47
1
vote
3 answers

pause/ play a game in cocos2d android?

How to pause a game in cocos2d android? I searched many tutorials but i did not found anywhere.I tried below code, it is working when paused from game scene.But it not working while resuming the game from pause scene in gameScene…
Rama
  • 1,156
  • 1
  • 7
  • 13
1
vote
2 answers

onDetroy() is called after calling onPause()

I develop cocos2d-x android. My question is when user press power button, is called onDestroy() after calling onPause(). This is connencted with memory leak problem? Why onDestroy() is called at that time? when it returns to app on Resume mode, it…
Chenggong Jin
  • 531
  • 1
  • 4
  • 9
1
vote
0 answers

How to implement in-app purchase in cocos2d android

I implemented a game using cocos2d android and it is almost getting done. I stuck at implementing in-app purchase for it. I searched all the way in google. but not found any clue to do it using cocos2d-android. Could any one help me out?
Gajini
  • 413
  • 1
  • 5
  • 21
1
vote
1 answer

Android NDK: WARNING: Ignoring unknown import directory: C

I'm working with cocos2dx 2.1.4 ndk-r8e.When I compile the ./build_native.sh I get the error as show I have tryed to solve the solution provide by googling but didnt helped can any one plz point out the problem below: here is image here is…
user2545129