Spinning FlareParts (#8637)

This commit is contained in:
MEEPofFaith
2023-05-28 00:06:57 -04:00
committed by GitHub
parent fc0f48e13d
commit 257d341703
@@ -9,7 +9,7 @@ import mindustry.graphics.*;
public class FlarePart extends DrawPart{ public class FlarePart extends DrawPart{
public int sides = 4; public int sides = 4;
public float radius = 100f, radiusTo = -1f, stroke = 6f, innerScl = 0.5f, innerRadScl = 0.33f; public float radius = 100f, radiusTo = -1f, stroke = 6f, innerScl = 0.5f, innerRadScl = 0.33f;
public float x, y, rotation, rotMove; public float x, y, rotation, rotMove, spinSpeed;
public boolean followRotation; public boolean followRotation;
public Color color1 = Pal.techBlue, color2 = Color.white; public Color color1 = Pal.techBlue, color2 = Color.white;
public PartProgress progress = PartProgress.warmup; public PartProgress progress = PartProgress.warmup;
@@ -29,7 +29,7 @@ public class FlarePart extends DrawPart{
float float
rx = params.x + Tmp.v1.x, rx = params.x + Tmp.v1.x,
ry = params.y + Tmp.v1.y, ry = params.y + Tmp.v1.y,
rot = (followRotation ? params.rotation : 0f) + rotMove * prog + rotation, rot = (followRotation ? params.rotation : 0f) + rotMove * prog + rotation + Time.time * spinSpeed,
rad = radiusTo < 0 ? radius : Mathf.lerp(radius, radiusTo, prog); rad = radiusTo < 0 ? radius : Mathf.lerp(radius, radiusTo, prog);
Draw.color(color1); Draw.color(color1);