?
This commit is contained in:
@@ -8,12 +8,17 @@ import mindustry.gen.*;
|
||||
import mindustry.world.blocks.*;
|
||||
|
||||
@Component
|
||||
abstract class LegsComp implements Posc, Flyingc, Hitboxc{
|
||||
abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc{
|
||||
transient float x, y;
|
||||
|
||||
float baseRotation, walkTime;
|
||||
|
||||
void drawLegs(){
|
||||
abstract TextureRegion legRegion();
|
||||
abstract TextureRegion baseRegion();
|
||||
|
||||
@Override
|
||||
public void drawGroundUnder(){
|
||||
Draw.mixcol(Color.white, hitAlpha());
|
||||
TextureRegion legRegion = null, baseRegion = null;
|
||||
|
||||
float ft = Mathf.sin(walkTime * vel().len() * 5f, 6f, 2f + hitSize() / 15f);
|
||||
|
||||
@@ -24,10 +29,10 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc{
|
||||
}
|
||||
|
||||
for(int i : Mathf.signs){
|
||||
Draw.rect(legRegion,
|
||||
x() + Angles.trnsx(baseRotation, ft * i),
|
||||
y() + Angles.trnsy(baseRotation, ft * i),
|
||||
legRegion.getWidth() * i * Draw.scl, legRegion.getHeight() * Draw.scl - Mathf.clamp(ft * i, 0, 2), baseRotation - 90);
|
||||
Draw.rect(legRegion(),
|
||||
x + Angles.trnsx(baseRotation, ft * i),
|
||||
y + Angles.trnsy(baseRotation, ft * i),
|
||||
legRegion().getWidth() * i * Draw.scl, legRegion().getHeight() * Draw.scl - Mathf.clamp(ft * i, 0, 2), baseRotation - 90);
|
||||
}
|
||||
|
||||
if(floor.isLiquid){
|
||||
@@ -36,7 +41,7 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc{
|
||||
Draw.color(Color.white);
|
||||
}
|
||||
|
||||
Draw.rect(baseRegion, x(), y(), baseRotation - 90);
|
||||
Draw.rect(baseRegion(), x, y, baseRotation - 90);
|
||||
|
||||
Draw.mixcol();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user