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

Android cocos2d removing a sprite after animation

I have an object going across the screen with an animation using the following code: CCSpriteFrameCache.sharedSpriteFrameCache().addSpriteFrames("ninjastar.plist"); CCSpriteSheet projectileSheet = CCSpriteSheet.spriteSheet("ninjastar.png"); …
Frozsht
  • 305
  • 1
  • 3
  • 8
0
votes
1 answer

How to remove the sprite when intersect with another sprite in cocos2d-android

In my cocos2d-android game app, there is a projectile, target and a ship, if projectiles and targets intersect both will disappear this works fine but when target falls on ship(intersect) ship is not getting removed, i tried searching in google but…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
0 answers

Android app crashes when trying to animate sprite using cocos2d

In my android game I'm trying to spawn a projectile that flies across the screen and has an animation using 4 .png files. However whenever a projectile spawns it crashes the entire app. Here's my code: protected void addProjectile() { CCSprite…
Frozsht
  • 305
  • 1
  • 3
  • 8
0
votes
2 answers

How to make "projectile"(bullets) to fire up when tapped or touched on the tip of the cannon in cocos2d android

I'm Developing android game app using Cocos2d-android game engine, in my game there is a cannon, when the player taps on the gamelayer "projectile" fires out, but according to my requirements when tapped on the tip of cannon "projectile" should come…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
1 answer

Null pointer exception error in cocos2d-android even though all the methods are declared and initialised properly

For an Game app using cocos2d-android i have given coding, but when i run the project it gets force close on Ontouch of the screen in game layer. and in the logcat getting null pointer exception, but all objects and variables are declared…
DD.
  • 973
  • 2
  • 10
  • 32
0
votes
1 answer

CCMoveTo is not woking in Cocos2d android

I am working on tetris type of game. In normal its working well. But when i press back and renters . bricks doesnt falls. That means CCMoveTo is not seems to be like working. here is my code part CCMoveTo actionMove1 =…
Akhilesh Sk
  • 451
  • 4
  • 18
0
votes
1 answer

How to move sprites from the Top to Bottom using Cocos2d Android?

I am trying to move a sprite from the top to bottom of the screen but I do not have any success at this moment... I've used the following as example. In this case, the sprites, are moving from left to right, and in my case I want to move them from…
leonardo
  • 121
  • 1
  • 5
0
votes
0 answers

compiling bash shell script in eclipse

bash ${workspace_loc: /com.todperkings.moleitx.moleitx}/build_native.sh NDK_DEBUG=1 V=1 it is a cocos-2dx project in android on windows 7. how to run this build command on eclipse. Cygwin is installed. Building and Monetizing Game Apps for…
androiddd
  • 9
  • 1
  • 2
0
votes
2 answers

How to replace scenes when clicked on imageview in cocos2d-android

i have started to develope an game app using cocos2d-android game engine, til now had put 4 imageview and a background image to the scene1, now if clicked on 1st imageview it should navigate to the next scene, i googled and youtube for this but did…
samm
  • 482
  • 5
  • 14
0
votes
1 answer

Box2d Cocos2d Android gravity not working

I'm trying to create a simple test for Box2d, Cocos2d, and Android. All I need is to put one body on the screen, and have it respond to gravity. I looked everywhere and there are good tutorials for non-Android applications but none of them has…
Eddy
  • 3,533
  • 13
  • 59
  • 89
0
votes
0 answers

How to set effect volume in cocos2d android?

I am new in cocos2d android. In my game, I used following code in game setting. SoundEngine.sharedEngine().setEffectsVolume(volume); where, volume is float in range of (0.0 to 1.0). But, there is no change in effect volume. Please give solution…
Bharat Godhani
  • 110
  • 4
  • 12
0
votes
2 answers

Android Cocos 2d

i am new to android and cocos2d for android .. i found the api at an unknown site first question is cocos2d officially available for android second i am having trouble with displaying animations please help i have images name "download (1).gif" too…
Ifti
  • 77
  • 11
0
votes
2 answers

animation with cocos2d android

I doing animation with framework cocos2d android.I have series image same blow image, I want to crop a tivi in image use to cocos2d in android. Plz help me? link image public class MainActivity extends Activity { private static final boolean DEBUG =…
Luc Le
  • 379
  • 1
  • 5
  • 13
0
votes
1 answer

Cocos2d removing objects in distance (java)

Hi i have sprite which is granade ^^ Problem is when it exploding. It should kill all targets in distance (in this case all on screen) but it kills them randomly. public void Explode(Object sender) { ArrayList targetsToBlow = new…
DProphet
  • 35
  • 6
0
votes
1 answer

Reading Facebook Response With Jannson JSON Reader

So long story short I have a android app and I used cocos2dx to dev it. One component I am working on is bringing my facebook friends into my game. The way I did it was on the native side (java) I setup my facebook sdk. I succefuly login and pull…
kub
  • 93
  • 1
  • 5