Untested support for JSON planets

This commit is contained in:
Anuken
2022-02-06 12:47:23 -05:00
parent 5fd139261f
commit fce3cf818e
10 changed files with 112 additions and 15 deletions
+1 -1
View File
@@ -428,7 +428,7 @@ public class Damage{
float amount = calculateDamage(scaled ? Math.max(0, entity.dst(x, y) - entity.type.hitSize/2) : entity.dst(x, y), radius, damage);
entity.damage(amount);
//TODO better velocity displacement
float dst = tr.set(entity.getX() - x, entity.getY() - y).len();
float dst = tr.set(entity.x - x, entity.y - y).len();
entity.vel.add(tr.setLength((1f - dst / radius) * 2f / entity.mass()));
if(complete && damage >= 9999999f && entity.isPlayer()){