mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-30 12:20:58 -08:00
commit
85d32cd510
9 changed files with 24 additions and 15 deletions
|
|
@ -72,8 +72,6 @@ public class Vars implements Loadable{
|
|||
public static final int maxTextLength = 150;
|
||||
/** max player name length in bytes */
|
||||
public static final int maxNameLength = 40;
|
||||
/** shadow color for turrets */
|
||||
public static final float turretShadowColor = Color.toFloatBits(0, 0, 0, 0.22f);
|
||||
/** displayed item size when ingame. */
|
||||
public static final float itemSize = 5f;
|
||||
/** units outside of this bound will die instantly */
|
||||
|
|
|
|||
|
|
@ -84,6 +84,18 @@ public class Drawf{
|
|||
Draw.color();
|
||||
}
|
||||
|
||||
public static void shadow(TextureRegion region, float x, float y, float rotation){
|
||||
Draw.color(Pal.shadow);
|
||||
Draw.rect(region, x, y, rotation);
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
public static void shadow(TextureRegion region, float x, float y){
|
||||
Draw.color(Pal.shadow);
|
||||
Draw.rect(region, x, y);
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
public static void dashCircle(float x, float y, float rad, Color color){
|
||||
Lines.stroke(3f, Pal.gray);
|
||||
Lines.dashCircle(x, y, rad);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public class Pal{
|
|||
darkishGray = new Color(0.3f, 0.3f, 0.3f, 1f),
|
||||
darkerGray = new Color(0.2f, 0.2f, 0.2f, 1f),
|
||||
darkestGray = new Color(0.1f, 0.1f, 0.1f, 1f),
|
||||
shadow = new Color(0, 0, 0, 0.22f),
|
||||
ammo = Color.valueOf("ff8947"),
|
||||
rubble = Color.valueOf("1c1817"),
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import mindustry.world.consumers.*;
|
|||
import static mindustry.Vars.*;
|
||||
|
||||
public class UnitType extends UnlockableContent{
|
||||
public static final float shadowTX = -12, shadowTY = -13, shadowColor = Color.toFloatBits(0, 0, 0, 0.22f), outlineSpace = 0.01f;
|
||||
public static final float shadowTX = -12, shadowTY = -13, outlineSpace = 0.01f;
|
||||
private static final Vec2 legOffset = new Vec2();
|
||||
|
||||
/** If true, the unit is always at elevation 1. */
|
||||
|
|
@ -409,7 +409,7 @@ public class UnitType extends UnlockableContent{
|
|||
}
|
||||
|
||||
public void drawShadow(Unit unit){
|
||||
Draw.color(shadowColor);
|
||||
Draw.color(Pal.shadow);
|
||||
float e = Math.max(unit.elevation, visualElevation);
|
||||
Draw.rect(shadowRegion, unit.x + shadowTX * e, unit.y + shadowTY * e, unit.rotation - 90);
|
||||
Draw.color();
|
||||
|
|
@ -594,7 +594,7 @@ public class UnitType extends UnlockableContent{
|
|||
if(leg.moving && visualElevation > 0){
|
||||
float scl = visualElevation;
|
||||
float elev = Mathf.slope(1f - leg.stage) * scl;
|
||||
Draw.color(shadowColor);
|
||||
Draw.color(Pal.shadow);
|
||||
Draw.rect(footRegion, leg.base.x + shadowTX * elev, leg.base.y + shadowTY * elev, position.angleTo(leg.base));
|
||||
Draw.color();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,9 +112,7 @@ public class PointDefenseTurret extends Block{
|
|||
@Override
|
||||
public void draw(){
|
||||
Draw.rect(baseRegion, x, y);
|
||||
Draw.color(Vars.turretShadowColor);
|
||||
Draw.rect(region, x - (size / 2f), y - (size / 2f), rotation - 90);
|
||||
Draw.color();
|
||||
Drawf.shadow(region, x - (size / 2f), y - (size / 2f), rotation - 90);
|
||||
Draw.rect(region, x, y, rotation - 90);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,9 +107,7 @@ public class TractorBeamTurret extends Block{
|
|||
@Override
|
||||
public void draw(){
|
||||
Draw.rect(baseRegion, x, y);
|
||||
Draw.color(Vars.turretShadowColor);
|
||||
Draw.rect(region, x - (size / 2f), y - (size / 2f), rotation - 90);
|
||||
Draw.color();
|
||||
Drawf.shadow(region, x - (size / 2f), y - (size / 2f), rotation - 90);
|
||||
Draw.rect(region, x, y, rotation - 90);
|
||||
|
||||
//draw laser if applicable
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import arc.struct.*;
|
|||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import arc.util.io.*;
|
||||
import mindustry.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
|
|
@ -203,9 +202,7 @@ public abstract class Turret extends Block{
|
|||
|
||||
tr2.trns(rotation, -recoil);
|
||||
|
||||
Draw.color(Vars.turretShadowColor);
|
||||
Draw.rect(region, x + tr2.x - (size / 2f), y + tr2.y - (size / 2f), rotation - 90);
|
||||
Draw.color();
|
||||
Drawf.shadow(region, x + tr2.x - (size / 2f), y + tr2.y - (size / 2f), rotation - 90);
|
||||
drawer.get(this);
|
||||
|
||||
if(heatRegion != Core.atlas.find("error")){
|
||||
|
|
|
|||
|
|
@ -188,6 +188,9 @@ public class MassDriver extends Block{
|
|||
|
||||
Draw.z(Layer.turret);
|
||||
|
||||
Drawf.shadow(region,
|
||||
x + Angles.trnsx(rotation + 180f, reload * knockback) - (size / 2),
|
||||
y + Angles.trnsy(rotation + 180f, reload * knockback) - (size / 2), rotation - 90);
|
||||
Draw.rect(region,
|
||||
x + Angles.trnsx(rotation + 180f, reload * knockback),
|
||||
y + Angles.trnsy(rotation + 180f, reload * knockback), rotation - 90);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import arc.math.*;
|
|||
import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
|
|
@ -70,6 +71,7 @@ public class RepairPoint extends Block{
|
|||
Draw.rect(baseRegion, x, y);
|
||||
|
||||
Draw.z(Layer.turret);
|
||||
Drawf.shadow(region, x - (size / 2), y - (size / 2), rotation - 90);
|
||||
Draw.rect(region, x, y, rotation - 90);
|
||||
|
||||
if(target != null && Angles.angleDist(angleTo(target), rotation) < 30f){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue