Bugfixes
This commit is contained in:
@@ -272,7 +272,7 @@ public class EntityProcess extends BaseProcessor{
|
|||||||
err("Type " + type + " has multiple components implementing non-void method " + entry.key + ".");
|
err("Type " + type + " has multiple components implementing non-void method " + entry.key + ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.value.sort(m -> m.has(MethodPriority.class) ? m.annotation(MethodPriority.class).value() : 0);
|
entry.value.sort(Structs.comps(Structs.comparingFloat(m -> m.has(MethodPriority.class) ? m.annotation(MethodPriority.class).value() : 0), Structs.comparing(Selement::name)));
|
||||||
|
|
||||||
//representative method
|
//representative method
|
||||||
Smethod first = entry.value.first();
|
Smethod first = entry.value.first();
|
||||||
|
|||||||
@@ -269,6 +269,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
ice = new Floor("ice"){{
|
ice = new Floor("ice"){{
|
||||||
dragMultiplier = 0.35f;
|
dragMultiplier = 0.35f;
|
||||||
|
speedMultiplier = 0.9f;
|
||||||
attributes.set(Attribute.water, 0.4f);
|
attributes.set(Attribute.water, 0.4f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,7 @@ public class EntityCollisions{
|
|||||||
tree.clear();
|
tree.clear();
|
||||||
|
|
||||||
group.each(s -> {
|
group.each(s -> {
|
||||||
s.lastX(s.getX());
|
s.updateLastPosition();
|
||||||
s.lastY(s.getY());
|
|
||||||
tree.insert(s);
|
tree.insert(s);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ abstract class EntityComp{
|
|||||||
return added;
|
return added;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(){}
|
|
||||||
|
|
||||||
void update(){}
|
void update(){}
|
||||||
|
|
||||||
void remove(){
|
void remove(){
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void moveAt(Vec2 vector){
|
void moveAt(Vec2 vector){
|
||||||
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
|
||||||
Vec2 t = Tmp.v3.set(vector).scl(floorSpeedMultiplier()); //target vector
|
Vec2 t = Tmp.v3.set(vector).scl(floorSpeedMultiplier()); //target vector
|
||||||
float mag = Tmp.v3.len();
|
float mag = Tmp.v3.len();
|
||||||
vel.x = Mathf.approach(vel.x, t.x, mag);
|
vel.x = Mathf.approach(vel.x, t.x, mag);
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
if(vel().len() > 0.5f){
|
float len = vel().len();
|
||||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed);
|
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||||
walkTime += Time.delta()*vel().len()/1f;
|
walkTime += Time.delta()*len/1f;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ abstract class VelComp implements Posc{
|
|||||||
final Vec2 vel = new Vec2();
|
final Vec2 vel = new Vec2();
|
||||||
float drag = 0f;
|
float drag = 0f;
|
||||||
|
|
||||||
|
//velocity needs to be called first, as it affects delta and lastPosition
|
||||||
|
@MethodPriority(-1)
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
move(vel.x, vel.y);
|
move(vel.x, vel.y);
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=0328073f1993cd1d72a237781c3cc1f82395234b
|
archash=68b2451bd0f8c6252ccf2c065a1c4b4896605183
|
||||||
|
|||||||
Reference in New Issue
Block a user