I have this game where I shoot these balls with a paddle. The obstacles are bricks which stop the bullets from going through them. However, I want the balls to bounce of the bricks at a random angle. Any help?
(here is my code for the ball):
public class Ball extends Animal
{
public void act()
{
move(6);
moveAround();
}
private void moveAround()
{
if (atWorldEdge())
{
turn(Greenfoot.getRandomNumber (30) - 30);
}
}
}
