diff --git a/core/assets/sprites/backgrounds/planet-zero.png b/core/assets/sprites/backgrounds/planet-zero.png deleted file mode 100644 index b1e13f744c..0000000000 Binary files a/core/assets/sprites/backgrounds/planet-zero.png and /dev/null differ diff --git a/core/assets/sprites/backgrounds/stars.png b/core/assets/sprites/backgrounds/stars.png deleted file mode 100644 index 41a8fadb7b..0000000000 Binary files a/core/assets/sprites/backgrounds/stars.png and /dev/null differ diff --git a/core/src/mindustry/content/Weathers.java b/core/src/mindustry/content/Weathers.java index 58bbafd09c..26f1349571 100644 --- a/core/src/mindustry/content/Weathers.java +++ b/core/src/mindustry/content/Weathers.java @@ -1,8 +1,14 @@ package mindustry.content; +import arc.*; +import arc.graphics.g2d.*; +import arc.math.*; +import arc.util.*; import mindustry.ctype.*; import mindustry.type.*; +import static mindustry.Vars.world; + public class Weathers implements ContentList{ public static Weather rain, @@ -11,9 +17,35 @@ public class Weathers implements ContentList{ @Override public void load(){ snow = new Weather("snow"){ + Rand rand = new Rand(); @Override public void draw(){ + rand.setSeed(0); + float yspeed = 2f, xspeed = 0.25f; + float padding = 16f; + float size = 12f; + Core.camera.bounds(Tmp.r1); + Tmp.r1.grow(padding); + + for(int i = 0; i < 100; i++){ + float scl = rand.random(0.5f, 1f); + float scl2 = rand.random(0.5f, 1f); + float sscl = rand.random(0.2f, 1f); + float x = (rand.random(0f, world.unitWidth()) + Time.time() * xspeed * scl2); + float y = (rand.random(0f, world.unitHeight()) - Time.time() * yspeed * scl); + + x += Mathf.sin(y, rand.random(30f, 80f), rand.random(1f, 7f)); + + x -= Tmp.r1.x; + y -= Tmp.r1.y; + x = Mathf.mod(x, Tmp.r1.width); + y = Mathf.mod(y, Tmp.r1.height); + x += Tmp.r1.x; + y += Tmp.r1.y; + + Draw.rect("circle-shadow", x, y, size * sscl, size * sscl); + } //TODO } }; diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 7cbee33912..2c6c02e311 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -32,7 +32,7 @@ public class Logic implements ApplicationListener{ public Logic(){ Events.on(WorldLoadEvent.class, event -> { //TODO remove later - Weathers.snow.create(); + //Weathers.snow.create(); }); Events.on(WaveEvent.class, event -> { diff --git a/core/src/mindustry/entities/def/UnitComp.java b/core/src/mindustry/entities/def/UnitComp.java index 1a8a3d12a4..7bcc8227d9 100644 --- a/core/src/mindustry/entities/def/UnitComp.java +++ b/core/src/mindustry/entities/def/UnitComp.java @@ -79,8 +79,8 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox Vec2 v = Geometry.overlap(Tmp.r1, Tmp.r2, true); float tm = mass() + unit.mass(); float s1 = mass() / tm, s2 = unit.mass() / tm; - impulse(v.x*s2/scale, v.y*s2/scale); - unit.impulse(-v.x*s1/scale, -v.y*s1/scale); + move(v.x*s2/scale, v.y*s2/scale); + unit.move(-v.x*s1/scale, -v.y*s1/scale); } @Override @@ -139,6 +139,11 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox tile.entity.unitOn(this); } + //kill when stuck in wall + if(isGrounded() && tile.solid()){ + kill(); + } + //apply damage if(floor.damageTaken > 0f){ damageContinuous(floor.damageTaken); diff --git a/core/src/mindustry/entities/units/AIController.java b/core/src/mindustry/entities/units/AIController.java index d5acecb965..bdb1279765 100644 --- a/core/src/mindustry/entities/units/AIController.java +++ b/core/src/mindustry/entities/units/AIController.java @@ -28,7 +28,7 @@ public class AIController implements UnitController{ } protected boolean retarget(){ - return timer.get(timerTarget, 20); + return timer.get(timerTarget, 30); } protected void targetClosest(){