mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-03-27 01:01:09 -07:00
Mech balancing / Less glitchy menu shader
This commit is contained in:
parent
bb59f45ba6
commit
e877310d85
6 changed files with 13 additions and 18 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue