diff --git a/core/assets-raw/sprites/blocks/distribution/core-top.png b/core/assets-raw/sprites/blocks/distribution/core-top.png index 432d616c02..f1d779149d 100644 Binary files a/core/assets-raw/sprites/blocks/distribution/core-top.png and b/core/assets-raw/sprites/blocks/distribution/core-top.png differ diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 12b5b9a7a1..244ffb485f 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 647b0e92d8..3a04c5ce04 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -135,11 +135,9 @@ public class Control extends Module{ Events.on(PlayEvent.class, () -> { for(Player player : players){ - player.set(world.getSpawnX(), world.getSpawnY()); + player.dead = true; } - Core.camera.position.set(world.getSpawnX(), world.getSpawnY(), 0); - state.set(State.playing); }); diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 7420b3c51b..be5d1db8a5 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -6,9 +6,9 @@ import com.badlogic.gdx.utils.TimeUtils; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.core.GameState.State; -import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.SyncEntity; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.gen.CallServer; import io.anuke.mindustry.io.Version; import io.anuke.mindustry.net.*; @@ -22,7 +22,6 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Build; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.BaseBulletType; import io.anuke.ucore.entities.Entities; import io.anuke.ucore.entities.EntityGroup; import io.anuke.ucore.modules.Module; @@ -106,7 +105,7 @@ public class NetServer extends Module{ player.name = packet.name; player.uuid = uuid; player.mech = packet.mobile ? Mechs.standardShip : Mechs.standard; - player.set(world.getSpawnX(), world.getSpawnY()); + player.dead = true; player.setNet(player.x, player.y); player.setNet(player.x, player.y); player.color.set(packet.color); diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index d50a5f2e7b..050c9ee611 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -55,15 +55,6 @@ public class World extends Module{ public Pathfinder pathfinder(){ return pathfinder; } - - //TODO proper spawnpoints! - public float getSpawnX(){ - return width() * tilesize/2f; - } - - public float getSpawnY(){ - return height() * tilesize/2f; - } public boolean solid(int x, int y){ Tile tile = tile(x, y); diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index fe090eaaf4..365f08015e 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -133,16 +133,10 @@ public class Player extends Unit implements BlockBuilder { @Override public void onRemoteDeath(){ dead = true; - respawning = true; + respawning = false; Effects.effect(ExplosionFx.explosion, this); Effects.shake(4f, 5f, this); Effects.sound("die", this); - - Timers.run(respawnduration + 5f, () -> { - heal(); - set(world.getSpawnX(), world.getSpawnY()); - interpolator.target.set(x, y); - }); } @Override diff --git a/core/src/io/anuke/mindustry/net/NetworkIO.java b/core/src/io/anuke/mindustry/net/NetworkIO.java index b1de73f210..b511e60f7e 100644 --- a/core/src/io/anuke/mindustry/net/NetworkIO.java +++ b/core/src/io/anuke/mindustry/net/NetworkIO.java @@ -166,7 +166,7 @@ public class NetworkIO { } } - player.set(world.getSpawnX(), world.getSpawnY()); + player.dead = true; world.endMapLoad(); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java index 0993e1b0d3..578df327bb 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java @@ -20,6 +20,7 @@ import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.util.EnumSet; import io.anuke.ucore.util.Mathf; +import static io.anuke.mindustry.Vars.debug; import static io.anuke.mindustry.Vars.state; public class CoreBlock extends StorageBlock { @@ -77,8 +78,6 @@ public class CoreBlock extends StorageBlock { size * Vars.tilesize /2f); Draw.reset(); - - //Draw.rect(name + (!entity.solid ? "-top-open" : "-top"), tile.drawx(), tile.drawy()); } } @@ -138,6 +137,11 @@ public class CoreBlock extends StorageBlock { entity.time += Timers.delta(); entity.progress += 1f / Vars.respawnduration; + //instant build for fast testing. + if(debug){ + entity.progress = 1f; + } + if(entity.progress >= 1f){ Effects.effect(Fx.spawn, entity); entity.progress = 0;