I'm failing the task with this error:
The onKeyPress(Key) method must call the createGame() method if the passed argument is Key.SPACE and the game is stopped (isGameStopped == true). Be sure that the onKeyPress(Key) method calls the createGame() method if the SPACE bar was pressed and isGameStopped == true.
package com.codegym.games.snake;
import com.codegym.engine.cell.*;
public class Apple extends GameObject {
private static final String APPLE_SIGN = "\uD83C\uDF4E";
public boolean isAlive = true;
public Apple(int x, int y) {
super(x,y);
}
public void draw(Game game) {
if(this.isAlive)
game.setCellValueEx(this.x,this.y,Color.NONE,APPLE_SIGN,Color.GREEN,75);
}
}