From aa61396b73698bce4d6055f89cfdec900f1f6f78 Mon Sep 17 00:00:00 2001 From: Julian Marrades Date: Mon, 28 May 2018 17:18:30 +0200 Subject: [PATCH] Landed debug --- core/src/com/group/golf/screens/CourseScreen.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/com/group/golf/screens/CourseScreen.java b/core/src/com/group/golf/screens/CourseScreen.java index 7bb4787..15eb54c 100644 --- a/core/src/com/group/golf/screens/CourseScreen.java +++ b/core/src/com/group/golf/screens/CourseScreen.java @@ -310,6 +310,12 @@ public void render(float delta) { // Check if the ball is stopped if (this.ball.getSize() == 0) { + // If landed print + if (this.landed) { + System.out.println("Ball landed: " + this.ball.getX() + " " + this.ball.getY()); + this.landed = false; + } + // Check if the goal is achieved if (this.collision.isGoalAchieved()) { this.winSound.play(); @@ -369,6 +375,7 @@ private void fileMoves() { double forceX = force * Math.cos(angle); double forceY = force * Math.sin(angle); this.engine.hit(forceX, forceY); + this.landed = true; this.counter++; this.hitSound.play(); } @@ -407,6 +414,7 @@ else if (this.touchFlag) { double force = MathLib.map(modulus, 0, 300, 0, 600); this.engine.hit(xLength, yLength); + this.landed = true; this.hitSound.play(); }