Better continuous laser bullet visuals (2)

This commit is contained in:
Anuken
2022-04-24 22:57:50 -04:00
parent 9251ba6008
commit 1d74011c3e

View File

@@ -14,8 +14,7 @@ public class ContinuousLaserBulletType extends ContinuousBulletType{
public float lightStroke = 40f;
public int divisions = 11;
public Color[] colors = {Color.valueOf("ec745855"), Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white};
public float[] strokes = {2f, 1.5f, 1f, 0.5f};
public float strokeFrom = 2f, strokeTo = 0.5f;
public float backLength = 7f, frontLength = 35f;
public float width = 9f, oscScl = 0.8f, oscMag = 1.5f;
@@ -50,10 +49,12 @@ public class ContinuousLaserBulletType extends ContinuousBulletType{
for(int i = 0; i < colors.length; i++){
Draw.color(Tmp.c1.set(colors[i]).mul(1f + Mathf.absin(Time.time, 1f, 0.1f)));
float stroke = (width + Mathf.absin(Time.time, oscScl, oscMag)) * fout * strokes[i];
float ellipseLenScl = Mathf.lerp(strokes[i] / 2f, 1f, 0.75f);
Lines.stroke(stroke);
float colorFin = i / (float)(colors.length - 1);
float baseStroke = Mathf.lerp(strokeFrom, strokeTo, colorFin);
float stroke = (width + Mathf.absin(Time.time, oscScl, oscMag)) * fout * baseStroke;
float ellipseLenScl = Mathf.lerp(1 - i / (float)(colors.length), 1f, 0.75f);
Lines.stroke(stroke);
Lines.lineAngle(b.x, b.y, rot, length - frontLength, false);
//back ellipse