Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/src/com/group/golf/screens/CourseScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down