Line power nodes

This commit is contained in:
Anuken 2018-11-30 15:14:27 -05:00
parent 58b87aa999
commit 7ec6586c4a
2 changed files with 4 additions and 19 deletions

View file

@ -40,9 +40,7 @@ public class Sorter extends Block implements SelectionTrait{
@Override
public void playerPlaced(Tile tile){
if(lastItem != null){
threads.runDelay(() -> Call.setSorterItem(null, tile, lastItem));
}
threads.runDelay(() -> Call.setSorterItem(null, tile, lastItem));
}
@Remote(targets = Loc.both, called = Loc.both, forward = true)

View file

@ -249,23 +249,10 @@ public class PowerNode extends PowerBlock{
x2 += t2.x;
y2 += t2.y;
float space = Vector2.dst(x1, y1, x2, y2);
float scl = 4f, mag = 2f, tscl = 4f, segscl = 3f;
Draw.color(Palette.powerLight, Palette.power, Mathf.absin(Timers.time(), 8f, 1f));
Lines.stroke(2f);
Lines.line(x1, y1, x2, y2);
int segments = Mathf.ceil(space / segscl);
Draw.color(Palette.power, Palette.powerLight, Mathf.absin(Timers.time(), 5f, 1f));
Lines.stroke(1f);
for(int i = 0; i < segments; i++){
float f1 = (float)i / segments;
float f2 = (float)(i+1) / segments;
t1.trns(angle1 + 90f, Mathf.lerp(Mathf.sin(tile.entity.id * 124f + Timers.time()/tscl + f1 * space, scl, mag), 0f, Math.abs(f1 - 0.5f)*2f));
t2.trns(angle1 + 90f, Mathf.lerp(Mathf.sin(tile.entity.id * 124f + Timers.time()/tscl + f2 * space, scl, mag), 0f, Math.abs(f2 - 0.5f)*2f));
Lines.line(x1 + (x2 - x1) * f1 + t1.x, y1 + (y2 - y1) * f1 + t1.y,
x1 + (x2 - x1) * f2 + t2.x, y1 + (y2 - y1) * f2 + t2.y);
}
}
}