Skip to content
Snippets Groups Projects
Commit 493f0419 authored by mkandel2's avatar mkandel2
Browse files

Final Touches

parent 3484e309
No related branches found
No related tags found
No related merge requests found
...@@ -147,8 +147,9 @@ public class GamePanel extends JPanel implements KeyListener, ActionListener { ...@@ -147,8 +147,9 @@ public class GamePanel extends JPanel implements KeyListener, ActionListener {
for (int k=0; k<noOfBallsToSpawn; k++) { for (int k=0; k<noOfBallsToSpawn; k++) {
boolean positiveXDirection = Math.random() > 0.5; boolean positiveXDirection = Math.random() > 0.5;
boolean positiveYDirection = Math.random() > 0.5; boolean positiveYDirection = Math.random() > 0.5;
int dirX = (positiveXDirection)? 1: -1; int powerUpSpeed = 3;
int dirY = (positiveYDirection)? 1: -1; int dirX = (positiveXDirection)? powerUpSpeed: -powerUpSpeed;
int dirY = (positiveYDirection)? powerUpSpeed: -powerUpSpeed;
Color color = Color.GRAY; Color color = Color.GRAY;
Ball newBall = new Ball(brickPosition.x, brickPosition.y, dirX, dirY, ball.radius, color); Ball newBall = new Ball(brickPosition.x, brickPosition.y, dirX, dirY, ball.radius, color);
newBallsToAdd.add(newBall); newBallsToAdd.add(newBall);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment