0

am doing one small game in android using cocos2d, I want to display a particle effect using plist files. I tried using the code below but I am getting a nullpointer exception. Without using a .png file, how can I display plist files?

GamestartLayer.clsss:

      public class GamestartLayer extends CCColorLayer {
    CCSprite ss;
    float movement;

   CGSize winSize = CCDirector.sharedDirector().displaySize();
    protected GamestartLayer(ccColor4B color) {
    super(color);
    // TODO Auto-generated constructor stub

    this.setIsTouchEnabled(true);
     ss=CCSprite.sprite("ant_1_1.png");
       ss.setPosition(CGPoint.ccp(768*0.5f, 1024*0.5f));
    this.addChild(ss,5);
    this.setIsAccelerometerEnabled(true);
    this.schedule("gameLogic"); 
       CCParticleSystem       fire=CCParticleFire.particleWithFile("Rocketfire2.plist");

       fire.setPosition(CGPoint.ccp(winSize.width/2.0f, winSize.height/2.0f));
       this.addChild(fire);
}

public static CCScene scene() {
    // TODO Auto-generated method stub
       CCScene scene = CCScene.node();


         GamestartLayer  layer = new GamestartLayer(ccColor4B.ccc4(225, 225,225, 225));

        //adds layer to scene
        scene.addChild(layer);

        return scene;
}

      }
Vishal Pawar
  • 4,324
  • 4
  • 28
  • 54
user1089640
  • 115
  • 1
  • 3
  • 14

1 Answers1

0

You can try WiEngine . It is the Best Cocos2d java cross platform port. Also check Wiengine's api Demo from the android market

Ali Imran
  • 8,927
  • 3
  • 39
  • 50
  • Also there is one more good 2d engine called `AndEngine` designed for android and have support of many new things like augmented reality :) – Ali Imran Dec 13 '12 at 08:17
  • ok,which frame work is best for developing 2d games in android – user1089640 Dec 13 '12 at 09:40
  • If you are developing specifically android `2D` game and also a beginner in android game development then `AndEngine` is a good start. – Ali Imran Dec 13 '12 at 10:33
  • ok.i wnat to develop a socifantacy type game.i ll try if u have any tutorials about andgamengine please send me.. – user1089640 Dec 13 '12 at 10:49