From 5e3f71f2367dc8b20df0e37b32fb8c3442f41a59 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Mon, 12 Nov 2018 15:46:47 +0400 Subject: [PATCH] Replace snake_case to camelCase --- core/src/com/me/brickbuster/entity/Ball.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/com/me/brickbuster/entity/Ball.java b/core/src/com/me/brickbuster/entity/Ball.java index be2fe4f..429730b 100644 --- a/core/src/com/me/brickbuster/entity/Ball.java +++ b/core/src/com/me/brickbuster/entity/Ball.java @@ -42,9 +42,9 @@ public class Ball extends Entity { Vector2 new_pos = getPos().cpy().add(direction.cpy().scl(speed * dt)); - boolean brick_collision = false; + boolean brickCollision = false; Iterator brickIterator = getBrickBuster().getBricks().iterator(); - while (!brick_collision && brickIterator.hasNext()) { + while (!brickCollision && brickIterator.hasNext()) { Brick brick = brickIterator.next(); Vector2[] vertices = brick.getVertices(); for(int i = 0; i < vertices.length; i++) { @@ -60,7 +60,7 @@ public class Ball extends Entity { speed = BOOST_SPEED; } Utils.reflect(direction, segment.nor()); - brick_collision = true; + brickCollision = true; break; } } @@ -103,6 +103,7 @@ public class Ball extends Entity { direction = paddleReflectAngle(); isStuck = false; } else { + // launch at random angle between 135 and 45 degrees float angle = MathUtils.random(MathUtils.PI/2) + MathUtils.PI/4; direction = new Vector2(MathUtils.cos(angle), MathUtils.sin(angle)); speed = DEFAULT_SPEED;