Skip to content

Commit 1551722

Browse files
authored
Merge pull request #82 from jCodingStuff/Julian
Landed debug
2 parents f13f9a8 + aa61396 commit 1551722

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/com/group/golf/screens/CourseScreen.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,12 @@ public void render(float delta) {
310310

311311
// Check if the ball is stopped
312312
if (this.ball.getSize() == 0) {
313+
// If landed print
314+
if (this.landed) {
315+
System.out.println("Ball landed: " + this.ball.getX() + " " + this.ball.getY());
316+
this.landed = false;
317+
}
318+
313319
// Check if the goal is achieved
314320
if (this.collision.isGoalAchieved()) {
315321
this.winSound.play();
@@ -369,6 +375,7 @@ private void fileMoves() {
369375
double forceX = force * Math.cos(angle);
370376
double forceY = force * Math.sin(angle);
371377
this.engine.hit(forceX, forceY);
378+
this.landed = true;
372379
this.counter++;
373380
this.hitSound.play();
374381
}
@@ -407,6 +414,7 @@ else if (this.touchFlag) {
407414
double force = MathLib.map(modulus, 0, 300, 0, 600);
408415

409416
this.engine.hit(xLength, yLength);
417+
this.landed = true;
410418

411419
this.hitSound.play();
412420
}

0 commit comments

Comments
 (0)