Laser optimization
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package io.anuke.mindustry.entities.traits;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.math.*;
|
||||
@@ -15,6 +16,8 @@ import io.anuke.mindustry.world.Tile;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public interface MinerTrait extends Entity{
|
||||
TextureRegion mineLaserRegion = Core.atlas.find("minelaser");
|
||||
TextureRegion mineLaserEndRegion = Core.atlas.find("minelaser-end");
|
||||
|
||||
/** Returns the range at which this miner can mine blocks.*/
|
||||
default float getMiningRange(){
|
||||
@@ -89,7 +92,7 @@ public interface MinerTrait extends Entity{
|
||||
|
||||
Draw.color(Color.LIGHT_GRAY, Color.WHITE, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl));
|
||||
|
||||
Shapes.laser("minelaser", "minelaser-end", px, py, ex, ey, 0.75f);
|
||||
Shapes.laser(mineLaserRegion, mineLaserEndRegion, px, py, ex, ey, 0.75f);
|
||||
|
||||
if(unit instanceof Player && ((Player)unit).isLocal){
|
||||
Lines.stroke(1f, Pal.accent);
|
||||
|
||||
Reference in New Issue
Block a user