mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-25 06:51:03 -07:00
Cleanup
This commit is contained in:
parent
39e3ae931c
commit
90f38fd135
8 changed files with 25 additions and 20 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
alpha=0
|
||||
block=1
|
||||
cix=17
|
||||
draug=2
|
||||
mindustry.entities.comp.BulletComp=3
|
||||
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 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
|
||||
abstract class BlockUnitComp implements Unitc{
|
||||
@Import Team team;
|
||||
|
||||
@ReadOnly Tilec tile;
|
||||
|
||||
public void tile(Tilec tile){
|
||||
|
|
@ -37,8 +39,11 @@ abstract class BlockUnitComp implements Unitc{
|
|||
|
||||
@Replace
|
||||
public void team(Team team){
|
||||
if(tile != null){
|
||||
tile.team(team);
|
||||
if(tile != null && this.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
|
||||
public void update(){
|
||||
//keep elevation halfway
|
||||
elevation = 0.5f;
|
||||
|
||||
int count = type().legCount;
|
||||
float legLength = type().legLength;
|
||||
|
||||
|
|
@ -34,19 +37,15 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
|
|||
}
|
||||
|
||||
float moveSpeed = 0.1f;
|
||||
|
||||
int div = Math.max(legs.length / 3, 2);
|
||||
|
||||
int div = Math.max(legs.length / 2, 2);
|
||||
float moveSpace = legLength / 1.6f / (div / 2f);
|
||||
|
||||
elevation = 0.5f;
|
||||
|
||||
totalLength += Mathf.dst(deltaX(), deltaY());
|
||||
|
||||
int stage = (int)(totalLength / moveSpace);
|
||||
int odd = stage % div;
|
||||
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);
|
||||
|
||||
|
|
@ -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 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];
|
||||
|
||||
//Tmp.v3.trns(Mathf.randomSeed(stage + i*3, 360f), 10f);
|
||||
Tmp.v3.setZero();
|
||||
|
||||
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);
|
||||
Tmp.v1.trns(dstRot, legLength).add(x, y).add(Tmp.v4);
|
||||
Tmp.v2.trns(rot2, legLength / 2f).add(x, y).add(Tmp.v4);
|
||||
|
||||
if(i % div == odd){
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(){
|
||||
elevation = 0.5f;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@ public class Layer{
|
|||
//blocks currently in progress *shaders used*
|
||||
blockBuilding = 40,
|
||||
|
||||
//ground units
|
||||
groundUnit = 50,
|
||||
|
||||
//turrets
|
||||
turret = 60,
|
||||
turret = 50,
|
||||
|
||||
//ground units
|
||||
groundUnit = 60,
|
||||
|
||||
//power lines
|
||||
power = 70,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
org.gradle.daemon=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||
archash=67ba53c2135dc53ad9c1e87843029a776a96cc26
|
||||
archash=c8cdb44c30f50d0350c403547ad25532ad77c465
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue