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
1 answer

Ignoring touches on transparent areas cocos2dx

I have an image of size 480x800 pixels and there is a icon on one corner which I need to place. What I want is that to ignore all touches on the transparent areas and detect only the area where the icon is. I found a solution in SO to this problem…
amyn
  • 922
  • 11
  • 24
0
votes
1 answer

Time Delay between the targets in cocos2d-android

There is no much time delay or gap between random targets fall that is there is a continous move of targets in my cocos2d-android game app, googled alot but could not get any, please help me guys below code is used for target. Random rand = new…
samm
  • 482
  • 5
  • 14
0
votes
1 answer

How to make the sprite respond to the touch on it in cocos2d android

Here is what i tried for projectile to do some action when clicked on gun(sprite) but when touched on the sprite canon1 "projectiles" are not coming out, please if anybody knows this help me. @Override public boolean ccTouchesBegan(MotionEvent…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
1 answer

How to draw a shape using cocos2d-android

I want to draw a rectangle shape using cocos2d-android . i googled all my way to draw the rectangle in my scene and trying CGRect rect = CGRect.make(numbers[0][0],numbers[0][1],70,70); but it was not displaying any rectangle. could any one help me…
Gajini
  • 413
  • 1
  • 5
  • 21
0
votes
1 answer

Touch event for sprite in cocos2d-android

In Order to make the sprite(canon) touch and react(firing bullet) to that touch in cocos2d-android, i have set this.setIsTouchEnabled(true); in constructor, and in ccToouchesBegan() added the below code @Override public boolean…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
2 answers

How to remove the sprite from parent in cocos2d-android

Topic In Cocos2d-android game: To delete the sprite after collided with another sprite, i have used spriteRect function, but this isnt making the sprite to get removed after intersect, after lot of googling got to know that it should be deleted from…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
1 answer

CGRect sprites issue in cocos2d-android

In my cocos2d-android game project, random number of targets falls from top surface on to the ship, when both intersect ship should get deleted, i have done the coding but "ship" is not getting deleted. is that CGRect sprite will not get deleted?…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
2 answers

How to make sprite removed permanently in cocos2d-android

i have used linkedlist to make the sprite display in cocos2d-android game app, if the sprite is destroyed it should get permanently destroyed and get removed, but this sprite disappears and again appears, dont know how to remove the sprite…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
1 answer

how to remove single sprite in cocos2d-android game

In this cocos2d-android game, if two sprites(ship and target) intersect ship should get disappeared, this is how i had given the code but could not remove the sprite after intersection, i searched through out google, but nothing helped me out, this…
samm
  • 482
  • 5
  • 14
0
votes
1 answer

Invocation TargetException and null Pointer Exception in android

i have this part of code in the project, in which getting "null pointer exception" in this line CGRect shipRect = CGRect.make(ship.getPosition().x - (ship.getContentSize().width), but i have declared the ship value as protected CCSprite ship; in the…
0
votes
1 answer

Including game levels in Cocos2d Android not taking to next scene

In Cocos2d android game i need to add levels so when the game completes it displays "You Win" after that i need to add the next level but when i try to add the following code its not replacing the scene ever. Can any one help me regarding this.…
Tycoon
  • 548
  • 1
  • 5
  • 19
0
votes
0 answers

How can I support multiresolution in cocos2d Android?

I am now working on a cocos2d Android game. During this game's development, I've faced some problems. This game runs in perfectly in Galaxy Tab, but when I run this game on a small device, the images do not appear properly. How can I resolve this…
ishu
  • 1,322
  • 1
  • 11
  • 15
0
votes
3 answers

How to make a screen appear moving right side after splash screen in android cocos2d

i am developing a game App using cocos2d android. After loading screen i have a menu screen and two more screen i need to get some effect like After the splash screen when it moves to next screen i need something like rotating or moving towards…
Tycoon
  • 548
  • 1
  • 5
  • 19
0
votes
2 answers

how to increase the score in cocos2d android when two sprites gets deleted

I have a sprite(image) when it collide with another score should be increament by 10, related code is given in the update method, but instead of this it increases randomly. here's my code. public void update(float dt) { LinkedList
samm
  • 482
  • 5
  • 14
0
votes
1 answer

How to get image.plist in android cocos2D

I am developing a game where i need .plist as in this line cache.addSpriteFrames("ninja.plist"); since i am new i dont know how to get .plist in cocos2d. Can any one help me how to get .plist for android cocos2d. Answers will be appreciated and it…
Tycoon
  • 548
  • 1
  • 5
  • 19