Advertisement
TNT_Block

ParticleGenerator.java

Sep 26th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. package de.cryptonicdev.cryptonic.particle;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Random;
  5. import java.util.Timer;
  6.  
  7. import org.lwjgl.input.Mouse;
  8. import org.lwjgl.opengl.GL11;
  9.  
  10. import de.cryptonicdev.cryptonic.utils.RenderUtils;
  11. import net.minecraft.util.MathHelper;
  12.  
  13. public class ParticleGenerator {
  14.  
  15. public static int anzahl;
  16. public static int breite;
  17. public static int höhe;
  18.  
  19. public ArrayList<Particle> particles = new ArrayList();
  20. private Random random = new Random();
  21. private Timer timer = new Timer();
  22.  
  23. public ParticleGenerator(int anzahl, int breite, int höhe) {
  24. this.anzahl = anzahl;
  25. this.breite = breite;
  26. this.höhe = höhe;
  27. for (int i = 0; i < anzahl; i++) {
  28. this.particles.add(new Particle(this.random.nextInt(breite), this.random.nextInt(höhe), RenderUtils.rainbow(i * 1000)));
  29. }
  30. }
  31.  
  32. public void drawParticles() {
  33. for (Particle p : this.particles)
  34. {
  35. p.draw();
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement