48 glowBounce =
new FaderUtil(0f, 0.1f + (
float) Math.random() * 0.1f, 0.1f + (
float) Math.random() * 0.1f);
60 float sizeRangeMult = 0.5f + 0.5f *
field.
params.density;
73 float cellX = (int) (Math.random() * cols);
74 float cellY = (int) (Math.random() * rows);
100 facing = (float) Math.random() * 360f;
101 angVel = (float) Math.random() * 360f - 180f;
106 float r = (float) Math.random();
107 r = (float) Math.sqrt(r);
108 float dist = r * spawnRadius;
117 vel.x += off - (float) Math.random() * 0.5f * off;
118 vel.y += off - (float) Math.random() * 0.5f * off;
119 if ((
float) Math.random() > 0.5f) {
124 float speed = 20f + (float) Math.random() * 100f;
127 timeLeft = 1f + (float) Math.random();
192 if (alphaMult <= 0)
return;
197 GL11.glTranslatef(
loc.x,
loc.y, 0);
199 GL11.glDisable(GL11.GL_TEXTURE_2D);
200 GL11.glEnable(GL11.GL_LINE_SMOOTH);
201 GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST);
203 float thickness = 1.5f;
204 GL11.glLineWidth(thickness);
206 GL11.glEnable(GL11.GL_BLEND);
208 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
217 float size =
width + 5f;
218 float half = size * 0.5f;
219 float corner = size * 0.25f;
229 float p = (f - 0.1f) / (0.4f - 0.1f);
230 glow = (float) (Math.sin(p * (
float) Math.PI * 6f - (
float) Math.PI) + 1f) / 2f;
239 for (
int i = 0; i < 2; i++) {
241 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
244 if (b <= 0)
continue;
246 GL11.glBegin(GL11.GL_LINE_STRIP);
248 GL11.glVertex2f(x - half, y + half - corner);
249 GL11.glVertex2f(x - half, y + half);
250 GL11.glVertex2f(x - half + corner, y + half);
253 GL11.glBegin(GL11.GL_LINE_STRIP);
255 GL11.glVertex2f(x + half, y + half - corner);
256 GL11.glVertex2f(x + half, y + half);
257 GL11.glVertex2f(x + half - corner, y + half);
260 GL11.glBegin(GL11.GL_LINE_STRIP);
262 GL11.glVertex2f(x - half, y - half + corner);
263 GL11.glVertex2f(x - half, y - half);
264 GL11.glVertex2f(x - half + corner, y - half);
267 GL11.glBegin(GL11.GL_LINE_STRIP);
269 GL11.glVertex2f(x + half, y - half + corner);
270 GL11.glVertex2f(x + half, y - half);
271 GL11.glVertex2f(x + half - corner, y - half);
277 GL11.glDisable(GL11.GL_LINE_SMOOTH);