Merge branch 'cool-drills' of git://github.com/sk7725/Mindustry into sk7725-cool-drills
This commit is contained in:
@@ -274,4 +274,13 @@ public class Drawf{
|
|||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Draws a sprite that should be lightwise correct. Provided sprite must be symmetrical. */
|
||||||
|
public static void spinSprite(TextureRegion region, float x, float y, float r){
|
||||||
|
r = Mathf.mod(r, 90f);
|
||||||
|
Draw.rect(region, x, y, r);
|
||||||
|
Draw.alpha(r / 90f);
|
||||||
|
Draw.rect(region, x, y, r - 90f);
|
||||||
|
Draw.alpha(1f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class Drill extends Block{
|
|||||||
public float updateEffectChance = 0.02f;
|
public float updateEffectChance = 0.02f;
|
||||||
|
|
||||||
public boolean drawRim = false;
|
public boolean drawRim = false;
|
||||||
|
public boolean drawSpinSprite = true;
|
||||||
public Color heatColor = Color.valueOf("ff5512");
|
public Color heatColor = Color.valueOf("ff5512");
|
||||||
public @Load("@-rim") TextureRegion rimRegion;
|
public @Load("@-rim") TextureRegion rimRegion;
|
||||||
public @Load("@-rotator") TextureRegion rotatorRegion;
|
public @Load("@-rotator") TextureRegion rotatorRegion;
|
||||||
@@ -314,7 +315,11 @@ public class Drill extends Block{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.rect(rotatorRegion, x, y, timeDrilled * rotateSpeed);
|
if(drawSpinSprite){
|
||||||
|
Drawf.spinSprite(rotatorRegion, x, y, timeDrilled * rotateSpeed);
|
||||||
|
}else{
|
||||||
|
Draw.rect(rotatorRegion, x, y, timeDrilled * rotateSpeed);
|
||||||
|
}
|
||||||
|
|
||||||
Draw.rect(topRegion, x, y);
|
Draw.rect(topRegion, x, y);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user