Skip to content

Commit ae2f6d8

Browse files
authored
Merge pull request #62 from im-yuuki/duklam
prprprpr
2 parents cb39542 + 6996d1d commit ae2f6d8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

client/src/main/java/io/exterminator3618/client/components/GameObject.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ public int getY() {
5151
return y;
5252
}
5353

54+
/**
55+
* Sets the X position.
56+
* @param x new X position in pixels
57+
*/
58+
public void setX(int x) {
59+
this.x = x;
60+
}
61+
62+
/**
63+
* Sets the Y position.
64+
* @param y
65+
*/
66+
public void setY(int y) {
67+
this.y = y;
68+
}
69+
5470
/**
5571
* @return width in pixels
5672
*/

client/src/main/java/io/exterminator3618/client/screens/GameScreen.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ public void render(float deltaTime) {
337337
}
338338

339339
// Lives
340+
if (ball.getY() <= 0){
341+
ball.setY(-100);
342+
}
343+
340344
if (ball.getY() <= 0 && extraBalls.isEmpty()) {
341345
lives--; // Trừ 1 mạng
342346
soundManager.play("sound/lose_heart.wav", false);

0 commit comments

Comments
 (0)