Replace snake_case to camelCase
This commit is contained in:
parent
d89a20134b
commit
5e3f71f236
@ -42,9 +42,9 @@ public class Ball extends Entity {
|
|||||||
|
|
||||||
Vector2 new_pos = getPos().cpy().add(direction.cpy().scl(speed * dt));
|
Vector2 new_pos = getPos().cpy().add(direction.cpy().scl(speed * dt));
|
||||||
|
|
||||||
boolean brick_collision = false;
|
boolean brickCollision = false;
|
||||||
Iterator<Brick> brickIterator = getBrickBuster().getBricks().iterator();
|
Iterator<Brick> brickIterator = getBrickBuster().getBricks().iterator();
|
||||||
while (!brick_collision && brickIterator.hasNext()) {
|
while (!brickCollision && brickIterator.hasNext()) {
|
||||||
Brick brick = brickIterator.next();
|
Brick brick = brickIterator.next();
|
||||||
Vector2[] vertices = brick.getVertices();
|
Vector2[] vertices = brick.getVertices();
|
||||||
for(int i = 0; i < vertices.length; i++) {
|
for(int i = 0; i < vertices.length; i++) {
|
||||||
@ -60,7 +60,7 @@ public class Ball extends Entity {
|
|||||||
speed = BOOST_SPEED;
|
speed = BOOST_SPEED;
|
||||||
}
|
}
|
||||||
Utils.reflect(direction, segment.nor());
|
Utils.reflect(direction, segment.nor());
|
||||||
brick_collision = true;
|
brickCollision = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,6 +103,7 @@ public class Ball extends Entity {
|
|||||||
direction = paddleReflectAngle();
|
direction = paddleReflectAngle();
|
||||||
isStuck = false;
|
isStuck = false;
|
||||||
} else {
|
} else {
|
||||||
|
// launch at random angle between 135 and 45 degrees
|
||||||
float angle = MathUtils.random(MathUtils.PI/2) + MathUtils.PI/4;
|
float angle = MathUtils.random(MathUtils.PI/2) + MathUtils.PI/4;
|
||||||
direction = new Vector2(MathUtils.cos(angle), MathUtils.sin(angle));
|
direction = new Vector2(MathUtils.cos(angle), MathUtils.sin(angle));
|
||||||
speed = DEFAULT_SPEED;
|
speed = DEFAULT_SPEED;
|
||||||
|
Loading…
Reference in New Issue
Block a user