diff --git a/core/src/com/me/brickbuster/entity/Ball.java b/core/src/com/me/brickbuster/entity/Ball.java index 2e78c1a..74b35d0 100644 --- a/core/src/com/me/brickbuster/entity/Ball.java +++ b/core/src/com/me/brickbuster/entity/Ball.java @@ -2,6 +2,7 @@ package com.me.brickbuster.entity; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; +import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; import com.me.brickbuster.BrickBuster; @@ -38,7 +39,8 @@ public class Ball extends Entity { } public void launch() { - direction = new Vector2(0, 1); + float angle = MathUtils.random(MathUtils.PI/2) + MathUtils.PI/4; + direction = new Vector2(MathUtils.cos(angle), MathUtils.sin(angle)); speed = 5; } } diff --git a/core/src/com/me/brickbuster/entity/Block.java b/core/src/com/me/brickbuster/entity/Block.java index 8ba9d7e..1504f64 100644 --- a/core/src/com/me/brickbuster/entity/Block.java +++ b/core/src/com/me/brickbuster/entity/Block.java @@ -23,6 +23,5 @@ public class Block extends Entity { @Override public void update(float dt) { - } }