Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ public int getY() {
return y;
}

/**
* Sets the X position.
* @param x new X position in pixels
*/
public void setX(int x) {
this.x = x;
}

/**
* Sets the Y position.
* @param y
*/
public void setY(int y) {
this.y = y;
}

/**
* @return width in pixels
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ public void render(float deltaTime) {
}

// Lives
if (ball.getY() <= 0){
ball.setY(-100);
}

if (ball.getY() <= 0 && extraBalls.isEmpty()) {
lives--; // Trừ 1 mạng
soundManager.play("sound/lose_heart.wav", false);
Expand Down
Loading