Major turret and bullet refactoring // New effects
This commit is contained in:
@@ -10,174 +10,34 @@ import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class BulletFx {
|
||||
public static Color lightOrange = Color.valueOf("f68021");
|
||||
public static Color lighterOrange = Color.valueOf("f6e096");
|
||||
|
||||
public static final Effect
|
||||
|
||||
chainshot = new Effect(9f, e -> {
|
||||
Draw.color(Color.WHITE, Fx.lightOrange, e.ifract());
|
||||
Lines.stroke(e.fract()*4f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*7f);
|
||||
Lines.stroke(e.fract()*2f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f);
|
||||
shootSmall = new Effect(8, e -> {
|
||||
Draw.color(lighterOrange, lightOrange, e.ifract());
|
||||
float w = 1f + 5 * e.fract();
|
||||
Shapes.tri(e.x, e.y, w, 15f * e.fract(), e.rotation);
|
||||
Shapes.tri(e.x, e.y, w, 3f * e.fract(), e.rotation + 180f);
|
||||
Draw.reset();
|
||||
}),
|
||||
mortarshot = new Effect(10f, e -> {
|
||||
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract());
|
||||
Lines.stroke(e.fract()*6f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*10f);
|
||||
Lines.stroke(e.fract()*5f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f);
|
||||
Lines.stroke(e.fract()*1f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
||||
|
||||
smokeParticleSmall = new Effect(20, e -> {
|
||||
Draw.color(Color.GRAY);
|
||||
Fill.circle(e.x, e.y, e.fract()*1.5f);
|
||||
Draw.reset();
|
||||
}),
|
||||
railshot = new Effect(9f, e -> {
|
||||
Draw.color(Color.WHITE, Color.DARK_GRAY, e.ifract());
|
||||
Lines.stroke(e.fract()*5f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*8f);
|
||||
Lines.stroke(e.fract()*4f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
||||
Lines.stroke(e.fract()*1f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*14f);
|
||||
Draw.reset();
|
||||
}),
|
||||
titanshot = new Effect(12f, e -> {
|
||||
Draw.color(Color.WHITE, Fx.lightOrange, e.ifract());
|
||||
Lines.stroke(e.fract()*7f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*12f);
|
||||
Lines.stroke(e.fract()*4f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*16f);
|
||||
Lines.stroke(e.fract()*2f);
|
||||
Lines.lineAngle(e.x, e.y, e.rotation, e.fract()*18f);
|
||||
Draw.reset();
|
||||
}),
|
||||
shockwaveSmall = new Effect(10f, e -> {
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||
Lines.stroke(e.fract()*2f + 0.1f);
|
||||
Lines.circle(e.x, e.y, e.ifract()*15f);
|
||||
Draw.reset();
|
||||
}),
|
||||
empshockwave = new Effect(7f, e -> {
|
||||
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
||||
Lines.stroke(e.fract()*2f);
|
||||
Lines.circle(e.x, e.y, e.ifract()*40f);
|
||||
Draw.reset();
|
||||
}),
|
||||
empspark = new Effect(13, e -> {
|
||||
Angles.randLenVectors(e.id, 7, 1f + e.ifract()*12f, (x, y)->{
|
||||
float len = 1f+e.fract()*6f;
|
||||
Draw.color(Color.SKY);
|
||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), len);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
shellsmoke = new Effect(20, e -> {
|
||||
Angles.randLenVectors(e.id, 8, 3f + e.ifract()*17f, (x, y)->{
|
||||
float size = 2f+e.fract()*5f;
|
||||
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract());
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
}),
|
||||
shellexplosion = new Effect(9, e -> {
|
||||
Lines.stroke(2f - e.ifract()*1.7f);
|
||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.ifract());
|
||||
Lines.circle(e.x, e.y, 3f + e.ifract() * 9f);
|
||||
Draw.reset();
|
||||
}),
|
||||
blastexplosion = new Effect(14, e -> {
|
||||
Lines.stroke(1.2f - e.ifract());
|
||||
Draw.color(Color.WHITE, Fx.lightOrange, e.ifract());
|
||||
Lines.circle(e.x, e.y, 1.5f + e.ifract() * 9f);
|
||||
Draw.reset();
|
||||
}),
|
||||
laserhit = new Effect(10, e -> {
|
||||
Lines.stroke(1f);
|
||||
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
||||
Lines.spikes(e.x, e.y, e.ifract() * 2f, 2, 6);
|
||||
Draw.reset();
|
||||
}),
|
||||
shieldhit = new Effect(9, e -> {
|
||||
Lines.stroke(1f);
|
||||
Draw.color(Color.WHITE, Color.SKY, e.ifract());
|
||||
Lines.spikes(e.x, e.y, e.ifract() * 5f, 2, 6);
|
||||
Lines.stroke(4f*e.fract());
|
||||
Lines.circle(e.x, e.y, e.ifract()*14f);
|
||||
Draw.reset();
|
||||
}),
|
||||
laserShoot = new Effect(8, e -> {
|
||||
Draw.color(Color.WHITE, Fx.lightOrange, e.ifract());
|
||||
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 6f, 2f, 0.8f);
|
||||
Draw.reset();
|
||||
}),
|
||||
spreadShoot = new Effect(12, e -> {
|
||||
Draw.color(Color.WHITE, Color.PURPLE, e.ifract());
|
||||
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 9f, 3.5f, 0.8f);
|
||||
Draw.reset();
|
||||
}),
|
||||
clusterShoot = new Effect(12, e -> {
|
||||
Draw.color(Color.WHITE, Fx.lightOrange, e.ifract());
|
||||
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2.5f, 0.7f);
|
||||
Draw.reset();
|
||||
}),
|
||||
vulcanShoot = new Effect(8, e -> {
|
||||
Draw.color(Fx.lighterOrange, Fx.lightOrange, e.ifract());
|
||||
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 10f, 2f, 0.7f);
|
||||
Draw.reset();
|
||||
}),
|
||||
shockShoot = new Effect(8, e -> {
|
||||
Draw.color(Color.WHITE, Color.ORANGE, e.ifract());
|
||||
Shapes.lineShot(e.x, e.y, e.rotation, 3, e.fract(), 14f, 4f, 0.8f);
|
||||
Draw.reset();
|
||||
}),
|
||||
beamShoot = new Effect(8, e -> {
|
||||
Draw.color(Fx.beamLight, Fx.beam, e.ifract());
|
||||
Shapes.lineShot(e.x, e.y, e.rotation - 70, 3, e.fract(), 12f, 1f, 0.5f);
|
||||
Shapes.lineShot(e.x, e.y, e.rotation + 70, 3, e.fract(), 12f, 1f, 0.5f);
|
||||
Draw.reset();
|
||||
}),
|
||||
beamhit = new Effect(8, e -> {
|
||||
Draw.color(Fx.beamLight, Fx.beam, e.ifract());
|
||||
Lines.stroke(e.fract()*3f+0.5f);
|
||||
Lines.circle(e.x, e.y, e.ifract()*8f);
|
||||
Lines.spikes(e.x, e.y, e.ifract()*6f, 2f, 4, 45);
|
||||
Draw.reset();
|
||||
}),
|
||||
blockexplosion = new Effect(13, e -> {
|
||||
Angles.randLenVectors(e.id+1, 8, 5f + e.ifract()*11f, (x, y)->{
|
||||
float size = 2f+e.fract()*8f;
|
||||
Draw.color(Color.LIGHT_GRAY, Color.DARK_GRAY, e.ifract());
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
|
||||
hit = new Effect(14, e -> {
|
||||
Draw.color(Color.WHITE, lighterOrange, e.ifract());
|
||||
Lines.stroke(0.5f + e.fract());
|
||||
|
||||
Angles.randLenVectors(e.id, 5, e.ifract()*15f, e.rotation, 50f, (x, y) -> {
|
||||
float ang = Mathf.atan2(x, y);
|
||||
Lines.lineAngle(e.x + x, e.y + y, ang, e.fract()*3 + 1f);
|
||||
});
|
||||
|
||||
Lines.stroke(2f*e.fract()+0.4f);
|
||||
Draw.color(Color.WHITE, Color.ORANGE, e.powfract());
|
||||
Lines.circle(e.x, e.y, 2f + e.powfract() * 9f);
|
||||
|
||||
Draw.color(e.ifract() < 0.5f ? Color.WHITE : Color.DARK_GRAY);
|
||||
Angles.randLenVectors(e.id, 5, 8f, (x, y)->{
|
||||
Fill.circle(e.x + x, e.y + y, e.fract()*5f + 1f);
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
}),
|
||||
clusterbomb = new Effect(10f, e -> {
|
||||
Draw.color(Color.WHITE, Fx.lightOrange, e.ifract());
|
||||
Lines.stroke(e.fract()*1.5f);
|
||||
Lines.poly(e.x, e.y, 4, e.fract()*8f);
|
||||
Lines.circle(e.x, e.y, e.ifract()*14f);
|
||||
Draw.reset();
|
||||
}),
|
||||
railsmoke = new Effect(30, e -> {
|
||||
Draw.color(Color.LIGHT_GRAY, Color.WHITE, e.ifract());
|
||||
float size = e.fract()*4f;
|
||||
Draw.rect("circle", e.x, e.y, size, size);
|
||||
Draw.reset();
|
||||
}),
|
||||
chainsmoke = new Effect(30, e -> {
|
||||
Draw.color(Fx.lightGray);
|
||||
float size = e.fract()*4f;
|
||||
Draw.rect("circle", e.x, e.y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ExplosionFx {
|
||||
generatorexplosion = new Effect(28, 40f, e -> {
|
||||
Angles.randLenVectors(e.id, 16, 10f + e.ifract()*8f, (x, y)->{
|
||||
float size = e.fract()*12f + 1f;
|
||||
Draw.color(Color.WHITE, Fx.lightOrange, e.ifract());
|
||||
Draw.color(Color.WHITE, Color.PURPLE, e.ifract());
|
||||
Draw.rect("circle", e.x + x, e.y + y, size, size);
|
||||
Draw.reset();
|
||||
});
|
||||
|
||||
@@ -4,21 +4,13 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.Colors;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.graphics.Hue;
|
||||
import io.anuke.ucore.graphics.Lines;
|
||||
|
||||
import static io.anuke.mindustry.Vars.respawnduration;
|
||||
import static io.anuke.mindustry.Vars.tilesize;
|
||||
|
||||
public class Fx{
|
||||
public static Color lightOrange = Color.valueOf("f68021");
|
||||
public static Color lighterOrange = Color.valueOf("f6e096");
|
||||
public static Color whiteOrange = Hue.mix(lightOrange, Color.WHITE, 0.6f);
|
||||
public static Color whiteYellow = Hue.mix(Color.YELLOW, Color.WHITE, 0.6f);
|
||||
public static Color lightGray = Color.valueOf("b0b0b0");
|
||||
public static Color glowy = Color.valueOf("fdc056");
|
||||
public static Color beam = Color.valueOf("9bffbe");
|
||||
public static Color beamLight = Color.valueOf("ddffe9");
|
||||
public static Color stoneGray = Color.valueOf("8f8f8f");
|
||||
|
||||
public static final Effect
|
||||
@@ -38,13 +30,6 @@ public class Fx{
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
hit = new Effect(10, e -> {
|
||||
Lines.stroke(1f);
|
||||
Draw.color(Color.WHITE, Color.ORANGE, e.ifract());
|
||||
Lines.spikes(e.x, e.y, e.ifract() * 3f, 2, 8);
|
||||
Draw.reset();
|
||||
}),
|
||||
|
||||
smoke = new Effect(100, e -> {
|
||||
Draw.color(Color.GRAY, new Color(0.3f, 0.3f, 0.3f, 1f), e.ifract());
|
||||
float size = 7f-e.ifract()*7f;
|
||||
|
||||
Reference in New Issue
Block a user