From 52593252c5b2c8016045b9377e3c263cfa85c725 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 10 Feb 2019 20:23:20 -0500 Subject: [PATCH] Wave balancing / Smoother conveyor items --- core/src/io/anuke/mindustry/content/Zones.java | 8 ++++---- .../mindustry/world/blocks/distribution/Conveyor.java | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/src/io/anuke/mindustry/content/Zones.java b/core/src/io/anuke/mindustry/content/Zones.java index 1ec4033aa7..386d715c69 100644 --- a/core/src/io/anuke/mindustry/content/Zones.java +++ b/core/src/io/anuke/mindustry/content/Zones.java @@ -195,7 +195,7 @@ public class Zones implements ContentList{ }}, new SpawnGroup(UnitTypes.dagger){{ - begin = 2; + begin = 1; spacing = 2; unitScaling = 2; }}, @@ -271,20 +271,20 @@ public class Zones implements ContentList{ }}, new SpawnGroup(UnitTypes.dagger){{ - begin = 2; + begin = 1; unitScaling = 1; spacing = 2; }}, new SpawnGroup(UnitTypes.dagger){{ - begin = 10; + begin = 11; spacing = 2; unitScaling = 2; unitAmount = 2; }}, new SpawnGroup(UnitTypes.ghoul){{ - begin = 5; + begin = 6; unitScaling = 0.5f; unitAmount = 1; spacing = 5; diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java index 9a393d321b..6165cdd92e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java @@ -181,7 +181,9 @@ public class Conveyor extends Block{ ConveyorEntity entity = tile.entity(); entity.minitem = 1f; + Tile next = tile.getNearby(tile.getRotation()); + float nextMax = next.block() instanceof Conveyor ? 1f - Math.max(itemSpace - next.entity().minitem, 0) : 1f; int minremove = Integer.MAX_VALUE; for(int i = entity.convey.size - 1; i >= 0; i--){ @@ -205,10 +207,9 @@ public class Conveyor extends Block{ pos.x = Mathf.lerpDelta(pos.x, 0, 0.1f); } - pos.y = Mathf.clamp(pos.y); + pos.y = Mathf.clamp(pos.y, 0, nextMax); if(pos.y >= 0.9999f && offloadDir(tile, pos.item)){ - Tile next = tile.getNearby(tile.getRotation()); if(next.block() instanceof Conveyor){ ConveyorEntity othere = next.entity();