Cleanup
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
alpha=0
|
alpha=0
|
||||||
block=1
|
block=1
|
||||||
|
cix=17
|
||||||
draug=2
|
draug=2
|
||||||
mindustry.entities.comp.BulletComp=3
|
mindustry.entities.comp.BulletComp=3
|
||||||
mindustry.entities.comp.DecalComp=4
|
mindustry.entities.comp.DecalComp=4
|
||||||
|
|||||||
BIN
core/assets-raw/sprites/units/cix-leg.png
Normal file
BIN
core/assets-raw/sprites/units/cix-leg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 223 B |
BIN
core/assets-raw/sprites/units/cix.png
Normal file
BIN
core/assets-raw/sprites/units/cix.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
@@ -8,6 +8,8 @@ import static mindustry.Vars.tilesize;
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
abstract class BlockUnitComp implements Unitc{
|
abstract class BlockUnitComp implements Unitc{
|
||||||
|
@Import Team team;
|
||||||
|
|
||||||
@ReadOnly Tilec tile;
|
@ReadOnly Tilec tile;
|
||||||
|
|
||||||
public void tile(Tilec tile){
|
public void tile(Tilec tile){
|
||||||
@@ -37,8 +39,11 @@ abstract class BlockUnitComp implements Unitc{
|
|||||||
|
|
||||||
@Replace
|
@Replace
|
||||||
public void team(Team team){
|
public void team(Team team){
|
||||||
if(tile != null){
|
if(tile != null && this.team != team){
|
||||||
tile.team(team);
|
this.team = team;
|
||||||
|
if(tile.team() != team){
|
||||||
|
tile.team(team);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
|
//keep elevation halfway
|
||||||
|
elevation = 0.5f;
|
||||||
|
|
||||||
int count = type().legCount;
|
int count = type().legCount;
|
||||||
float legLength = type().legLength;
|
float legLength = type().legLength;
|
||||||
|
|
||||||
@@ -34,19 +37,15 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
float moveSpeed = 0.1f;
|
float moveSpeed = 0.1f;
|
||||||
|
int div = Math.max(legs.length / 2, 2);
|
||||||
int div = Math.max(legs.length / 3, 2);
|
|
||||||
|
|
||||||
float moveSpace = legLength / 1.6f / (div / 2f);
|
float moveSpace = legLength / 1.6f / (div / 2f);
|
||||||
|
|
||||||
elevation = 0.5f;
|
|
||||||
|
|
||||||
totalLength += Mathf.dst(deltaX(), deltaY());
|
totalLength += Mathf.dst(deltaX(), deltaY());
|
||||||
|
|
||||||
int stage = (int)(totalLength / moveSpace);
|
int stage = (int)(totalLength / moveSpace);
|
||||||
int odd = stage % div;
|
int odd = stage % div;
|
||||||
float movespace = 360f / legs.length / 4f;
|
float movespace = 360f / legs.length / 4f;
|
||||||
float trns = vel().len() * 12.5f * div/2f;
|
float trns = vel().len() * 12.5f * div/1.5f;
|
||||||
|
|
||||||
Tmp.v4.trns(rotation, trns);
|
Tmp.v4.trns(rotation, trns);
|
||||||
|
|
||||||
@@ -54,15 +53,10 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
float dstRot = rotation + 360f / legs.length * i + (360f / legs.length / 2f);
|
float dstRot = rotation + 360f / legs.length * i + (360f / legs.length / 2f);
|
||||||
float rot2 = Angles.moveToward(dstRot, rotation + (Angles.angleDist(dstRot, rotation) < 90f ? 180f : 0), movespace);
|
float rot2 = Angles.moveToward(dstRot, rotation + (Angles.angleDist(dstRot, rotation) < 90f ? 180f : 0), movespace);
|
||||||
|
|
||||||
//float ox = Mathf.randomSeedRange(i, 6f), oy = Mathf.randomSeedRange(i, 6f);
|
|
||||||
|
|
||||||
Leg l = legs[i];
|
Leg l = legs[i];
|
||||||
|
|
||||||
//Tmp.v3.trns(Mathf.randomSeed(stage + i*3, 360f), 10f);
|
Tmp.v1.trns(dstRot, legLength).add(x, y).add(Tmp.v4);
|
||||||
Tmp.v3.setZero();
|
Tmp.v2.trns(rot2, legLength / 2f).add(x, y).add(Tmp.v4);
|
||||||
|
|
||||||
Tmp.v1.trns(dstRot, legLength).add(x, y).add(Tmp.v3).add(Tmp.v4);
|
|
||||||
Tmp.v2.trns(rot2, legLength / 2f).add(x, y).add(Tmp.v3).add(Tmp.v4);
|
|
||||||
|
|
||||||
if(i % div == odd){
|
if(i % div == odd){
|
||||||
l.base.lerpDelta(Tmp.v1, moveSpeed);
|
l.base.lerpDelta(Tmp.v1, moveSpeed);
|
||||||
@@ -72,4 +66,9 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||||||
l.joint.lerpDelta(Tmp.v2, moveSpeed / 4f);
|
l.joint.lerpDelta(Tmp.v2, moveSpeed / 4f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(){
|
||||||
|
elevation = 0.5f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ public class Layer{
|
|||||||
//blocks currently in progress *shaders used*
|
//blocks currently in progress *shaders used*
|
||||||
blockBuilding = 40,
|
blockBuilding = 40,
|
||||||
|
|
||||||
//ground units
|
|
||||||
groundUnit = 50,
|
|
||||||
|
|
||||||
//turrets
|
//turrets
|
||||||
turret = 60,
|
turret = 50,
|
||||||
|
|
||||||
|
//ground units
|
||||||
|
groundUnit = 60,
|
||||||
|
|
||||||
//power lines
|
//power lines
|
||||||
power = 70,
|
power = 70,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=67ba53c2135dc53ad9c1e87843029a776a96cc26
|
archash=c8cdb44c30f50d0350c403547ad25532ad77c465
|
||||||
|
|||||||
Reference in New Issue
Block a user