fix: typo, I'm stupid

This commit is contained in:
Laureηt 2021-04-09 16:56:29 +02:00
parent 0301d8af71
commit 1d887cad5c

View file

@ -16,9 +16,9 @@ public class Arrow extends Actor {
// ---------- ATTRIBUTEs ---------- // ---------- ATTRIBUTEs ----------
private Vector2 velocity = new Vector2(); private Vector2 velocity;
private Vector2 acceleration = new Vector2(); private Vector2 acceleration;
private Vector2 force = new Vector2(); private Vector2 force;
private float TTL = 20; private float TTL = 20;
@ -56,10 +56,11 @@ public class Arrow extends Actor {
for (Actor actor : GameScreen.planets.getChildren()) { for (Actor actor : GameScreen.planets.getChildren()) {
float dx = actor.getX() - this.getX(); float dx = actor.getX() - this.getX();
float dy = actor.getX() - this.getX(); float dy = actor.getY() - this.getY();
float len2 = dx*dx + dy*dy; float len2 = dx*dx + dy*dy;
float coeff = SagittariusGame.G * ((Planet) actor).getMass() * (float) Math.pow(len2, -3/2);
float coeff = (float) (SagittariusGame.G * ((Planet) actor).getMass() * Math.pow(len2, -3/2));
float gravityX = coeff * dx; float gravityX = coeff * dx;
float gravityY = coeff * dy; float gravityY = coeff * dy;