что не так в методе checkBricksBump ?
package com.javarush.task.task24.task2413;
import java.util.List;
public class Arkanoid {
private int width;
private int height;
private boolean isGameOver;
private Ball ball;
private Stand stand;
private List<Brick> bricks;
public Ball getBall() {
return ball;
}
public void setBall(Ball ball) {
this.ball = ball;
}
public Stand getStand() {
return stand;
}
public void setStand(Stand stand) {
this.stand = stand;
}
public List<Brick> getBricks() {
return bricks;
}
public void setBricks(List<Brick> bricks) {
this.bricks = bricks;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public Arkanoid(int width, int height) {
this.width = width;
this.height = height;
}
void run() {
}
void move() {
ball.move();
stand.move();
}
static Arkanoid game;
void draw(Canvas canvas) {
ball.draw(canvas);
stand.draw(canvas);
for (Brick b : bricks) {
b.draw(canvas);
}
}
public void checkBricksBump() {
for (Brick b : bricks) {
if (ball.isIntersec(b)) {
double angle = Math.random() * 360;
ball.setDirection(angle);
bricks.remove(b);
}
}
}
public void checkStandBump() {
if (stand.isIntersec(ball)) {
double angle = 90 + 20 * (Math.random() - 0.5);
ball.setDirection(angle);
}
}
public void checkEndGame() {
if (ball.y > height) {
isGameOver = true;
}
}
public static void main(String[] args) {
}
}