У меня есть подозрения что я неправильно указал условие в if-е
package com.javarush.games.snake;
import com.javarush.engine.cell.*;
public class SnakeGame extends Game {
public static final int WIDTH = 15;
public static final int HEIGHT = 15;
private Snake snake;
private int turnDelay;
public void initialize (){
setScreenSize(WIDTH, HEIGHT);
createGame();
}
private void drawScene (){
for (int x = 0 ; x < WIDTH ; x++){
for (int y = 0 ; y < HEIGHT ; y++){
setCellValueEx(x, y, Color.DARKSEAGREEN, "");
}
}
snake.draw(this);
}
private void createGame (){
turnDelay = 300;
snake = new Snake(WIDTH/2, HEIGHT/2);
setTurnTimer(turnDelay);
snake.move();
drawScene();
}
public void onTurn(int step) {
snake.move();
drawScene();
}
}