Mech balancing / Less glitchy menu shader

This commit is contained in:
Anuken 2018-09-03 13:33:40 -04:00
parent bb59f45ba6
commit e877310d85
6 changed files with 13 additions and 18 deletions

View file

@ -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;
}

View file

@ -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";

View file

@ -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

View file

@ -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;

View file

@ -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;
{

View file

@ -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;