mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-24 05:28:42 +07:00
Merge branch 'cool-drills' of git://github.com/sk7725/Mindustry into sk7725-cool-drills
This commit is contained in:
commit
1db5a9f3c2
@ -274,4 +274,13 @@ public class Drawf{
|
||||
|
||||
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 boolean drawRim = false;
|
||||
public boolean drawSpinSprite = true;
|
||||
public Color heatColor = Color.valueOf("ff5512");
|
||||
public @Load("@-rim") TextureRegion rimRegion;
|
||||
public @Load("@-rotator") TextureRegion rotatorRegion;
|
||||
@ -314,7 +315,11 @@ public class Drill extends Block{
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
if(drawSpinSprite){
|
||||
Drawf.spinSprite(rotatorRegion, x, y, timeDrilled * rotateSpeed);
|
||||
}else{
|
||||
Draw.rect(rotatorRegion, x, y, timeDrilled * rotateSpeed);
|
||||
}
|
||||
|
||||
Draw.rect(topRegion, x, y);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user