Bugfixes
This commit is contained in:
@@ -269,6 +269,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
ice = new Floor("ice"){{
|
||||
dragMultiplier = 0.35f;
|
||||
speedMultiplier = 0.9f;
|
||||
attributes.set(Attribute.water, 0.4f);
|
||||
}};
|
||||
|
||||
|
||||
@@ -115,8 +115,7 @@ public class EntityCollisions{
|
||||
tree.clear();
|
||||
|
||||
group.each(s -> {
|
||||
s.lastX(s.getX());
|
||||
s.lastY(s.getY());
|
||||
s.updateLastPosition();
|
||||
tree.insert(s);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,8 +19,6 @@ abstract class EntityComp{
|
||||
return added;
|
||||
}
|
||||
|
||||
void init(){}
|
||||
|
||||
void update(){}
|
||||
|
||||
void remove(){
|
||||
|
||||
@@ -32,7 +32,6 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
||||
}
|
||||
|
||||
void moveAt(Vec2 vector){
|
||||
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
||||
Vec2 t = Tmp.v3.set(vector).scl(floorSpeedMultiplier()); //target vector
|
||||
float mag = Tmp.v3.len();
|
||||
vel.x = Mathf.approach(vel.x, t.x, mag);
|
||||
|
||||
@@ -13,10 +13,9 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
if(vel().len() > 0.5f){
|
||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed);
|
||||
walkTime += Time.delta()*vel().len()/1f;
|
||||
}
|
||||
float len = vel().len();
|
||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||
walkTime += Time.delta()*len/1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,8 @@ abstract class VelComp implements Posc{
|
||||
final Vec2 vel = new Vec2();
|
||||
float drag = 0f;
|
||||
|
||||
//velocity needs to be called first, as it affects delta and lastPosition
|
||||
@MethodPriority(-1)
|
||||
@Override
|
||||
public void update(){
|
||||
move(vel.x, vel.y);
|
||||
|
||||
Reference in New Issue
Block a user