Mech balancing / Less glitchy menu shader
This commit is contained in:
@@ -14,20 +14,20 @@ varying vec4 v_color;
|
|||||||
varying vec2 v_texCoord;
|
varying vec2 v_texCoord;
|
||||||
|
|
||||||
void main() {
|
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;
|
int roundx = 8;
|
||||||
float roundy = roundx;
|
int roundy = roundx;
|
||||||
float roundm = 0.2;
|
float roundm = 0.2;
|
||||||
|
|
||||||
coords.x = float(int(coords.x / roundx)) * roundx;
|
coords.x = (coords.x / roundx) * roundx;
|
||||||
coords.y = float(int(coords.y / roundy)) * roundy;
|
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));
|
float m = abs(sin(-u_time/50.0 + d/120.0));
|
||||||
m = float(int(m / roundm)) * roundm + roundm;
|
m = float(int(m / roundm)) * roundm + roundm;
|
||||||
|
|
||||||
gl_FragColor.rgb = mix(v_color.rgb, vec3(0.0), m);
|
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;
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,6 @@ public class Vars{
|
|||||||
//team of the enemy in waves
|
//team of the enemy in waves
|
||||||
public static final Team waveTeam = Team.red;
|
public static final Team waveTeam = Team.red;
|
||||||
|
|
||||||
//discord group URL
|
|
||||||
public static final String discordURL = "https://discord.gg/mindustry";
|
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 releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||||
public static final String crashReportURL = "http://mindustry.us.to/report";
|
public static final String crashReportURL = "http://mindustry.us.to/report";
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class Mechs implements ContentList{
|
|||||||
boostSpeed = 0.8f;
|
boostSpeed = 0.8f;
|
||||||
weapon = Weapons.healBlaster;
|
weapon = Weapons.healBlaster;
|
||||||
maxSpeed = 5f;
|
maxSpeed = 5f;
|
||||||
armor = 35f;
|
armor = 20f;
|
||||||
altChargeAlpha = 0.05f;
|
altChargeAlpha = 0.05f;
|
||||||
trailColorTo = Palette.heal;
|
trailColorTo = Palette.heal;
|
||||||
}
|
}
|
||||||
@@ -150,8 +150,6 @@ public class Mechs implements ContentList{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateAlt(Player player){
|
public void updateAlt(Player player){
|
||||||
//idle regen
|
|
||||||
player.healBy(0.01f * Timers.delta());
|
|
||||||
|
|
||||||
if(player.altHeat >= 0.91f){
|
if(player.altHeat >= 0.91f){
|
||||||
Effects.effect(UnitFx.healWave, player);
|
Effects.effect(UnitFx.healWave, player);
|
||||||
@@ -197,7 +195,7 @@ public class Mechs implements ContentList{
|
|||||||
weapon = Weapons.swarmer;
|
weapon = Weapons.swarmer;
|
||||||
trailColorTo = Color.valueOf("feb380");
|
trailColorTo = Color.valueOf("feb380");
|
||||||
maxSpeed = 3.5f;
|
maxSpeed = 3.5f;
|
||||||
armor = 50f;
|
armor = 45f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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;
|
bulletWidth = 8f;
|
||||||
bulletHeight = 8f;
|
bulletHeight = 8f;
|
||||||
@@ -105,7 +105,7 @@ public class MissileBullets extends BulletList implements ContentList{
|
|||||||
homingRange = 60f;
|
homingRange = 60f;
|
||||||
keepVelocity = false;
|
keepVelocity = false;
|
||||||
splashDamageRadius = 25f;
|
splashDamageRadius = 25f;
|
||||||
splashDamage = 11f;
|
splashDamage = 10f;
|
||||||
lifetime = 120f;
|
lifetime = 120f;
|
||||||
trailColor = Color.GRAY;
|
trailColor = Color.GRAY;
|
||||||
backColor = Palette.bulletYellowBack;
|
backColor = Palette.bulletYellowBack;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class TurretBullets extends BulletList implements ContentList{
|
|||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
|
|
||||||
healBullet = new BulletType(5.2f, 19){
|
healBullet = new BulletType(5.2f, 16){
|
||||||
float healAmount = 21f;
|
float healAmount = 21f;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -415,9 +415,7 @@ public class Renderer extends RendererModule{
|
|||||||
public Vector2 averagePosition(){
|
public Vector2 averagePosition(){
|
||||||
avgPosition.setZero();
|
avgPosition.setZero();
|
||||||
|
|
||||||
drawAndInterpolate(playerGroup, p -> p.isLocal, p -> {
|
drawAndInterpolate(playerGroup, p -> p.isLocal, p -> avgPosition.add(p.x, p.y));
|
||||||
avgPosition.add(p.x, p.y);
|
|
||||||
});
|
|
||||||
|
|
||||||
avgPosition.scl(1f / players.length);
|
avgPosition.scl(1f / players.length);
|
||||||
return avgPosition;
|
return avgPosition;
|
||||||
|
|||||||
Reference in New Issue
Block a user