From e877310d855096aa82d050676ccf2842fdb5b2fa Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 3 Sep 2018 13:33:40 -0400 Subject: [PATCH] Mech balancing / Less glitchy menu shader --- core/assets/shaders/menu.fragment | 14 +++++++------- core/src/io/anuke/mindustry/Vars.java | 1 - core/src/io/anuke/mindustry/content/Mechs.java | 6 ++---- .../mindustry/content/bullets/MissileBullets.java | 4 ++-- .../mindustry/content/bullets/TurretBullets.java | 2 +- core/src/io/anuke/mindustry/core/Renderer.java | 4 +--- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/core/assets/shaders/menu.fragment b/core/assets/shaders/menu.fragment index d9a9895eb9..2638f466f9 100644 --- a/core/assets/shaders/menu.fragment +++ b/core/assets/shaders/menu.fragment @@ -14,20 +14,20 @@ varying vec4 v_color; varying vec2 v_texCoord; void main() { - vec2 coords = ((v_texCoord.xy - u_uv) / (u_uv2 - u_uv) - vec2(0.5, 0.5)) * u_resolution/u_scl; + ivec2 coords = ivec2((gl_FragCoord.xy - u_resolution/2.0)/u_scl); - float roundx = 8.0; - float roundy = roundx; + int roundx = 8; + int roundy = roundx; float roundm = 0.2; - coords.x = float(int(coords.x / roundx)) * roundx; - coords.y = float(int(coords.y / roundy)) * roundy; + coords.x = (coords.x / roundx) * roundx; + coords.y = (coords.y / roundy) * roundy; - float d = abs(coords.x) - abs(coords.y); + float d = (abs(float(coords.x)) - abs(float(coords.y))); float m = abs(sin(-u_time/50.0 + d/120.0)); m = float(int(m / roundm)) * roundm + roundm; gl_FragColor.rgb = mix(v_color.rgb, vec3(0.0), m); - gl_FragColor.a = mod(abs(coords.x) + abs(coords.y), 110.0) < 35.0 ? 1.0 : 0.0; + gl_FragColor.a = mod(abs(float(coords.x)) + abs(float(coords.y)), 110.0) < 35.0 ? 1.0 : 0.0; } \ No newline at end of file diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index a8a079b9c5..d07add4353 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -37,7 +37,6 @@ public class Vars{ //team of the enemy in waves public static final Team waveTeam = Team.red; - //discord group URL public static final String discordURL = "https://discord.gg/mindustry"; public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases"; public static final String crashReportURL = "http://mindustry.us.to/report"; diff --git a/core/src/io/anuke/mindustry/content/Mechs.java b/core/src/io/anuke/mindustry/content/Mechs.java index bc322083bf..9602e47455 100644 --- a/core/src/io/anuke/mindustry/content/Mechs.java +++ b/core/src/io/anuke/mindustry/content/Mechs.java @@ -137,7 +137,7 @@ public class Mechs implements ContentList{ boostSpeed = 0.8f; weapon = Weapons.healBlaster; maxSpeed = 5f; - armor = 35f; + armor = 20f; altChargeAlpha = 0.05f; trailColorTo = Palette.heal; } @@ -150,8 +150,6 @@ public class Mechs implements ContentList{ @Override public void updateAlt(Player player){ - //idle regen - player.healBy(0.01f * Timers.delta()); if(player.altHeat >= 0.91f){ Effects.effect(UnitFx.healWave, player); @@ -197,7 +195,7 @@ public class Mechs implements ContentList{ weapon = Weapons.swarmer; trailColorTo = Color.valueOf("feb380"); maxSpeed = 3.5f; - armor = 50f; + armor = 45f; } @Override diff --git a/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java b/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java index 5db0273a20..b018179866 100644 --- a/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java @@ -96,7 +96,7 @@ public class MissileBullets extends BulletList implements ContentList{ } }; - swarm = new MissileBulletType(2.7f, 14, "missile"){ + swarm = new MissileBulletType(2.7f, 12, "missile"){ { bulletWidth = 8f; bulletHeight = 8f; @@ -105,7 +105,7 @@ public class MissileBullets extends BulletList implements ContentList{ homingRange = 60f; keepVelocity = false; splashDamageRadius = 25f; - splashDamage = 11f; + splashDamage = 10f; lifetime = 120f; trailColor = Color.GRAY; backColor = Palette.bulletYellowBack; diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java index a8a6af9967..7d4a93cf74 100644 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java @@ -36,7 +36,7 @@ public class TurretBullets extends BulletList implements ContentList{ @Override public void load(){ - healBullet = new BulletType(5.2f, 19){ + healBullet = new BulletType(5.2f, 16){ float healAmount = 21f; { diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 91dcd11c91..8e889ca6de 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -415,9 +415,7 @@ public class Renderer extends RendererModule{ public Vector2 averagePosition(){ avgPosition.setZero(); - drawAndInterpolate(playerGroup, p -> p.isLocal, p -> { - avgPosition.add(p.x, p.y); - }); + drawAndInterpolate(playerGroup, p -> p.isLocal, p -> avgPosition.add(p.x, p.y)); avgPosition.scl(1f / players.length); return avgPosition;