Fully implemented teleporters

This commit is contained in:
Anuken
2018-04-07 19:31:42 -04:00
parent 7ea4a503f7
commit 4b39e5fab6
10 changed files with 110 additions and 33 deletions

View File

@@ -24,6 +24,7 @@ public class Blocks {
space = new Floor("space") {{
variants = 0;
drawLayer = DrawLayer.space;
solid = true;
}},
deepwater = new Floor("deepwater") {{

View File

@@ -8,6 +8,7 @@ import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Fill;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.tilesize;
@@ -213,5 +214,27 @@ public class BlockFx {
Fill.poly(e.x + x, e.y + y, 4, 0.5f+e.fout()*2f, 45);
Draw.reset();
});
}),
teleport = new Effect(60, e -> {
Draw.color(e.color);
Lines.stroke(e.fin()*2f);
Lines.circle(e.x, e.y, 7f + e.fout()*8f);
Angles.randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin()*4f + 1f);
});
Draw.reset();
}),
teleportOut = new Effect(20, e -> {
Draw.color(e.color);
Lines.stroke(e.fout()*2f);
Lines.circle(e.x, e.y, 7f + e.fin()*8f);
Angles.randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> {
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope()*4f + 1f);
});
Draw.reset();
});
}