Package org.newdawn.slick.particles

Examples of org.newdawn.slick.particles.Particle


      public void update(ParticleSystem system, int delta) {
        this.timer -= delta;
        if(this.timer <= 0) {
          this.timer = INTERVAL;
         
          Particle p = system.getNewParticle(this, 5000);
          p.setColor(1.0f, 1.0f, 1.0f, 0.0f);
          p.setPosition((float) ((Math.random() - 0.5f) * 200.0f), 0);
          p.setSize(100.0f);
        }
      }

      public void updateParticle(Particle particle, int delta) {
        particle.adjustVelocity(((float) Math.random() - 0.5f) * 0.005f, ((float) Math.random() - 0.45f) * -0.003f);
 
View Full Code Here


      public void update(ParticleSystem system, int delta) {
        this.timer -= delta;
        if(this.timer <= 0) {
          this.timer = INTERVAL;
         
          Particle p = system.getNewParticle(this, 5000);
          p.setColor(0.0f, 0.72f, 0.92f, 0.7f);
          p.setPosition((float) ((Math.random() - 0.5f) * 75.0f), 0);
          p.setSize(120.0f);
          p.setVelocity(0, 0.3f);
        }
      }

      public void updateParticle(Particle particle, int delta) {
        if(particle.getY() / AbstractState.ZOOM > WaterfallEmitterFactory.this.verticalSize) {
View Full Code Here

      public void update(ParticleSystem system, int delta) {
        this.timer -= delta;
        if (this.timer <= 0) {
          this.timer = INTERVAL;

          Particle p = system.getNewParticle(this, 5000);
          p.setColor(1.0f, 1.0f, 1.0f, 0.0f);
          p.setPosition((float) (Math.random() - 0.5f) * 150.0f,
              (float) (Math.random() - 0.5f) * 150.0f);
          p.setVelocity((float) (p.getX() / 150.0f) * 0.25f,
              (float) (p.getY() / 150.0f) * 0.25f);
          p.setColor(0.886f, 0.69f, 0.027f, 0.5f);
          p.setSize(30.0f);
        }
      }

      public void updateParticle(Particle particle, int delta) {
        particle.adjustVelocity(
View Full Code Here

      public void update(ParticleSystem system, int delta) {
        this.timer -= delta;
        if (this.timer <= 0) {
          this.timer = INTERVAL;

          Particle p = system.getNewParticle(this, 5000);
          p.setColor(1.0f, 1.0f, 1.0f, 0.0f);
          p.setPosition((float) ((Math.random() - 0.5f) * 200.0f), 0);
          p.setSize(100.0f);
        }
      }

      public void updateParticle(Particle particle, int delta) {
        particle.adjustVelocity(
View Full Code Here

      public void update(ParticleSystem system, int delta) {
        this.timer -= delta;
        if (this.timer <= 0) {
          this.timer = INTERVAL;

          Particle p = system.getNewParticle(this, 5000);
          p.setColor(1.0f, 1.0f, 1.0f, 0.0f);
          p.setPosition(
              (float) ((Math.random() - 0.5f)
                  * AirFlowEmitterFactory.this.width * AirFlowEmitterFactory.this.rotatedDirection.x),
              (float) ((Math.random() - 0.5f)
                  * AirFlowEmitterFactory.this.width * AirFlowEmitterFactory.this.rotatedDirection.y));
          p.setVelocity(AirFlowEmitterFactory.this.direction.x
              * AirFlowEmitterFactory.this.speed,
              AirFlowEmitterFactory.this.direction.y
                  * AirFlowEmitterFactory.this.speed);
          p.setColor(0.8f, 0.8f, 0.8f, 0.25f);
          p.setSize(50.0f);
        }
      }

      public void updateParticle(Particle particle, int delta) {
        if (new Vector(particle.getX(), particle.getY()).squareAbs() > AirFlowEmitterFactory.this.distance
View Full Code Here

      public void update(ParticleSystem system, int delta) {
        this.timer -= delta;
        if (this.timer <= 0) {
          this.timer = INTERVAL;

          Particle p = system.getNewParticle(this, 5000);
          p.setColor(0.0f, 0.72f, 0.92f, 0.7f);
          p.setPosition((float) ((Math.random() - 0.5f) * 75.0f), 0);
          p.setSize(120.0f);
          p.setVelocity(0, 0.3f);
        }
      }

      public void updateParticle(Particle particle, int delta) {
        if (particle.getY()
View Full Code Here

      timer = interval;
      for (int i = 0; i < 20; i++) {
        double a = Math.PI * 2 * Math.random();
        float parX = (float) (radius * Math.cos(a));
        float parY = (float) (radius * Math.sin(a));
        Particle p = system.getNewParticle(this, 1000);
        p.setColor(1, 1, 1, 0.5f);
        p.setPosition(x, y);
        p.setSize(size);
        p.setVelocity(parX, parY, 0.005f);
      }

    }
  }
View Full Code Here

    if (nextSpawn < 0) {
      nextSpawn = (int) spawnInterval.value();
      int count = (int) spawnCount.value();

      for (int i = 0; i < count; i++) {
        Particle p = system.getNewParticle(this, initialLife.value());
        p.setSize(initialSize.value());
        p.setPosition(x + xOffset.value(), y + yOffset.value());
        p.setVelocity(0, 0, 0);

        float dist = initialDistance.value();
        float power = speed.value();
        if ((dist != 0) || (power != 0)) {
          float s = spread.value();
          float ang = (s + angularOffset.value() - (spread.value() / 2)) - 90;
          float xa = (float) FastTrig.cos(Math.toRadians(ang)) * dist;
          float ya = (float) FastTrig.sin(Math.toRadians(ang)) * dist;
          p.adjustPosition(xa, ya);

          float xv = (float) FastTrig.cos(Math.toRadians(ang));
          float yv = (float) FastTrig.sin(Math.toRadians(ang));
          p.setVelocity(xv, yv, power * 0.001f);
        }

        if (image != null) {
          p.setImage(image);
        }

        ColorRecord start = (ColorRecord) colors.get(0);
        p.setColor(start.col.r, start.col.g, start.col.b, startAlpha.value() / 255.0f);
        p.setUsePoint(usePoints);
        p.setOriented(useOriented);

        if (emitCount.value() != -1) {
          leftToEmit--;
          if (leftToEmit <= 0) {
            break;
View Full Code Here

   */
  public void update(ParticleSystem system, int delta) {
    timer -= delta;
    if (timer <= 0) {
      timer = interval;
      Particle p = system.getNewParticle(this, 1000);
      p.setColor(1, 1, 1, 0.5f);
      p.setPosition(x, y);
      p.setSize(size);
      float vx = (float) (-0.02f + (Math.random() * 0.04f));
      float vy = (float) (-(Math.random() * 0.15f));
      p.setVelocity(vx,vy,1.1f);
    }
  }
 
View Full Code Here

TOP

Related Classes of org.newdawn.slick.particles.Particle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.