Move any stuck balls along with paddle when shields get added/removed
This commit is contained in:
parent
7588a0986b
commit
1c7e20f8e9
@ -122,11 +122,21 @@ public class PlayState extends State {
|
|||||||
public void addShield() {
|
public void addShield() {
|
||||||
shieldCount++;
|
shieldCount++;
|
||||||
paddle.setY(paddle.getY() + SHIELD_HEIGHT);
|
paddle.setY(paddle.getY() + SHIELD_HEIGHT);
|
||||||
|
for (Ball ball : balls) {
|
||||||
|
if (ball.isStuck()) {
|
||||||
|
ball.setY(ball.getY() + SHIELD_HEIGHT);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeShield() {
|
public void removeShield() {
|
||||||
shieldCount--;
|
shieldCount--;
|
||||||
paddle.setY(paddle.getY() - SHIELD_HEIGHT);
|
paddle.setY(paddle.getY() - SHIELD_HEIGHT);
|
||||||
|
for (Ball ball : balls) {
|
||||||
|
if (ball.isStuck()) {
|
||||||
|
ball.setY(ball.getY() - SHIELD_HEIGHT);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ballReset() {
|
public void ballReset() {
|
||||||
|
Loading…
Reference in New Issue
Block a user