Getting the following error:
com/codegym/games/snake/part06/Snake.java:12: error: constructor GameObject in class com.codegym.games.snake.part06.GameObject cannot be applied to given types;
public Snake(int x, int y){
^
required: int,int
found: no arguments
reason: actual and formal argument lists differ in length
could someone explain what this error means? I don't understand why I'd need to consider the parameters of the GameObject constructor if I am creating a new constructor. Plus, the parameters of the Snake constructor (int, int) are the same as the GameObject constructor (int, int), so I'm just not sure what I'm doing wrongpackage com.codegym.games.snake;
import com.codegym.engine.cell.*;
public class SnakeGame extends Game {
public static final int WIDTH = 15;
public static final int HEIGHT = 15;
private Snake snake;
@Override
public void initialize() {
setScreenSize(WIDTH, HEIGHT);
createGame();
}
private void createGame() {
snake = new Snake(WIDTH/2, HEIGHT/2);
drawScene();
}
private void drawScene() {
for (int x = 0; x < WIDTH; x++) {
for (int y = 0; y < HEIGHT; y++) {
setCellColor(x, y, Color.ORANGE);
}
}
snake.draw(this);
}
}