Particulas GLES1

per Jordi Farrero darrera modificació 2020-03-25T14:54:55+01:00

text/plain particle.txt — 1.1 KB

Continguts del fitxer

		public PointParticleEmitter emitter1;
		public ParticleSystem particle1;

		emitter1 = new PointParticleEmitter(0, 0);
		particle1  = new ParticleSystem(emitter1, 30, 40, 200, BitmapTextureAtlasTextureRegionFactory.createFromAsset(TextureAtlas, cActivity, "particle.png", 50, 0));
		particle1.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE);

		particle1.addParticleInitializer(new VelocityInitializer(0, 0, 0, 0));
		particle1.addParticleInitializer(new AccelerationInitializer(1, 1));
		particle1.addParticleInitializer(new RotationInitializer(0.0f, 360.0f));
		particle1.addParticleInitializer(new ColorInitializer(0.6f, 0.6f, 0.6f));

		particle1.addParticleModifier(new ScaleModifier(0.8f, 1.7f, 0, 4));
		particle1.addParticleModifier(new ExpireModifier(1.5f));
		particle1.addParticleModifier(new AlphaModifier(1.0f, 0.0f, 0.5f, 1.5f));
		particle1.addParticleModifier(new AlphaModifier(0.0f, 1.0f, 1.5f, 1.5f));
		particle1.setZIndex(14);
		
		emitter1.setCenter(op.getX(),op.getY());
		GameScene.attachChild(particle1);
		particle1.setVisible(true);