WIP low-tier leg unit

This commit is contained in:
Anuken
2022-02-25 22:23:50 -05:00
parent 7245364a55
commit 7650226f25
20 changed files with 91 additions and 202 deletions

View File

@@ -147,8 +147,8 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
Leg l = legs[i];
//TODO is limiting twice necessary?
l.joint.sub(baseOffset).limit(type.maxStretch * legLength/2f).add(baseOffset);
l.base.sub(baseOffset).limit(type.maxStretch * legLength).add(baseOffset);
l.joint.sub(baseOffset).clampLength(type.maxCompress * legLength/2f, type.maxStretch * legLength/2f).add(baseOffset);
l.base.sub(baseOffset).clampLength(type.maxCompress * legLength, type.maxStretch * legLength).add(baseOffset);
float stageF = (totalLength + i*type.legPairOffset) / moveSpace;
int stage = (int)stageF;
@@ -212,8 +212,8 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
l.joint.lerpDelta(jointDest, moveSpeed / 4f);
//limit again after updating
l.joint.sub(baseOffset).limit(type.maxStretch * legLength/2f).add(baseOffset);
l.base.sub(baseOffset).limit(type.maxStretch * legLength).add(baseOffset);
l.joint.sub(baseOffset).clampLength(type.maxCompress * legLength/2f, type.maxStretch * legLength/2f).add(baseOffset);
l.base.sub(baseOffset).clampLength(type.maxCompress * legLength, type.maxStretch * legLength).add(baseOffset);
}
//when at least 1 leg is touching land, it can't drown