Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.cryptonicdev.cryptonic.particle;
- import java.util.Random;
- import org.lwjgl.input.Keyboard;
- import de.cryptonicdev.cryptonic.utils.RenderUtils;
- import net.minecraft.client.gui.Gui;
- import net.minecraft.util.MathHelper;
- public class Particle {
- public int x;
- public int y;
- public int k;
- public ParticleGenerator pg;
- public boolean reset;
- public float size;
- private Random random = new Random();
- private int color;
- public Particle(int x, int y, int color) {
- this.x = x;
- this.y = y;
- this.color = color;
- this.size = genRandom(0.7F, 0.8F);
- }
- public void draw() {
- if (x == -1){
- x = pg.breite;
- reset = true;
- }
- if (y == -1){
- y = pg.höhe;
- reset = true;
- }
- this.x -= random.nextInt(2);
- this.y -= random.nextInt(2);
- int xx = (int) (MathHelper.cos(0.1F * (this.x + this.k)) * 10.0F);
- RenderUtils.drawBorderedCircle(this.x + xx, this.y, this.size, 0, color);
- }
- public float genRandom(float min, float max) {
- return (float) (min + Math.random() * (max - min + 1.0F));
- }
- }
Add Comment
Please, Sign In to add comment