From 59a3cfe85bdf7a771f902d97f2d0939e5c2e2220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Fri, 9 Apr 2021 16:58:32 +0200 Subject: [PATCH] fix: Trajectory prediction is BACK !:: --- core/src/sagittarius/model/Arrow.java | 7 ------- core/src/sagittarius/model/Bow.java | 17 ++++++----------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/core/src/sagittarius/model/Arrow.java b/core/src/sagittarius/model/Arrow.java index 450b7cc..864c5d7 100644 --- a/core/src/sagittarius/model/Arrow.java +++ b/core/src/sagittarius/model/Arrow.java @@ -104,13 +104,6 @@ public class Arrow extends Actor { this.velocity.y += dt * ( this.acceleration.y + this.force.y ) / 2; } -// ---------- GRAPHICAL METHODs ---------- - - public void render(ShapeRenderer shapeRenderer) { - // Vector2 tail = new Vector2(-this.length, 0).rotateDeg(this.getRotation()).add(this.position); - // shapeRenderer.line(this.getX(), this.getY(), tail.x, tail.y); - } - @Override public void draw(Batch batch, float parentAlpha) { super.draw(batch, parentAlpha); diff --git a/core/src/sagittarius/model/Bow.java b/core/src/sagittarius/model/Bow.java index 67378b0..77e9009 100644 --- a/core/src/sagittarius/model/Bow.java +++ b/core/src/sagittarius/model/Bow.java @@ -74,18 +74,13 @@ class Bow extends Actor { super.drawDebug(shapes); if (pressed) { shapes.line(this.anchor, GameScreen.worldCursor); + if (aimAssist) { + float[] traj = Arrow.traj(angle, power, shooter, 400, 0.05f); + if (traj.length > 2) { + shapes.polyline(traj); + } + } } } - // void render(ShapeRenderer shapeRenderer) { - // if (pressed) { - // if (aimAssist) { - // float[] traj = Arrow.traj(angle, power, shooter, 400, 0.05f); - // if (traj.length > 2) { - // shapeRenderer.polyline(traj); - // } - // } - // } - // }) - }