This commit is contained in:
Anuken 2021-01-13 10:43:04 -05:00
parent 9ce5164a7e
commit c2602fe6a0
3 changed files with 13 additions and 7 deletions

View File

@ -74,7 +74,7 @@ public class Control implements ApplicationListener, Loadable{
Events.on(WorldLoadEvent.class, event -> {
if(Mathf.zero(player.x) && Mathf.zero(player.y)){
Building core = state.teams.closestCore(0, 0, player.team());
Building core = player.bestCore();
if(core != null){
player.set(core);
camera.position.set(core);

View File

@ -15,6 +15,7 @@ import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.graphics.g3d.*;
import mindustry.ui.*;
import mindustry.world.blocks.storage.CoreBlock.*;
import static arc.Core.*;
import static mindustry.Vars.*;
@ -36,6 +37,7 @@ public class Renderer implements ApplicationListener{
/** minZoom = zooming out, maxZoom = zooming in */
public float minZoom = 1.5f, maxZoom = 6f;
private @Nullable CoreBuild landCore;
//TODO unused
private FxProcessor fx = new FxProcessor();
private Color clearColor = new Color(0f, 0f, 0f, 1f);
@ -62,6 +64,10 @@ public class Renderer implements ApplicationListener{
if(settings.getBool("bloom", !ios)){
setupBloom();
}
Events.on(WorldLoadEvent.class, e -> {
landCore = player.bestCore();
});
}
@Override
@ -284,25 +290,25 @@ public class Renderer implements ApplicationListener{
}
private void drawLanding(){
if(landTime > 0 && player.closestCore() != null){
CoreBuild entity = landCore == null ? player.bestCore() : landCore;
if(landTime > 0 && entity != null){
float fract = landTime / Fx.coreLand.lifetime;
Building entity = player.closestCore();
TextureRegion reg = entity.block.icon(Cicon.full);
float scl = Scl.scl(4f) / camerascale;
float s = reg.width * Draw.scl * scl * 4f * fract;
Draw.color(Pal.lightTrail);
Draw.rect("circle-shadow", entity.getX(), entity.getY(), s, s);
Draw.rect("circle-shadow", entity.x, entity.y, s, s);
Angles.randLenVectors(1, (1f- fract), 100, 1000f * scl * (1f-fract), (x, y, fin, fout) -> {
Lines.stroke(scl * fin);
Lines.lineAngle(entity.getX() + x, entity.getY() + y, Mathf.angle(x, y), (fin * 20 + 1f) * scl);
Lines.lineAngle(entity.x + x, entity.y + y, Mathf.angle(x, y), (fin * 20 + 1f) * scl);
});
Draw.color();
Draw.mixcol(Color.white, fract);
Draw.rect(reg, entity.getX(), entity.getY(), reg.width * Draw.scl * scl, reg.height * Draw.scl * scl, fract * 135f);
Draw.rect(reg, entity.x, entity.y, reg.width * Draw.scl * scl, reg.height * Draw.scl * scl, fract * 135f);
Draw.reset();
}

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=78fdeeda71a4bb2d46e81d936beccf8727d95388
archash=f89e6a465fe9d139bd192960c2ebdff33c2af86a