cannot find symbol symbol: class Game location: class com.codegym.games.snake.part06.Snake.
file com/codegym/games/snake/part06/Snake.java, line 24, position 977
What's the mistake in the code that I am getting this error?
package 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; //handling drawing of snake from SnakeGame class by creating a variable Snake snake. It will store snake's curernt StackTraceElement
@Override
public void initialize() {
// Here we perform all actions to initialize
//the game and its objects
setScreenSize(WIDTH, HEIGHT); //setting the screensize.
createGame(); //calling creategame method which in turn calls draw scene method.
}
private void createGame() {
Snake snake = new Snake(WIDTH/2, HEIGHT/2);
snake.draw(this);
drawScene(); // calling the drawscene method in creategame method
//Apple apple = new Apple(7,7); //calling Apple class and creating an isntance with parameters to locate the apple(or an object)
//apple.draw(this); //calling draw(Game) method on this newly created apple.
}
private void drawScene() { //creating a method to draw the game
for (int x = 0; x < WIDTH; x++){
for (int y = 0; y < HEIGHT; y++){ //nested for loop to set the color of the cells.
setCellColor(x, y, Color.YELLOW);
}
}
snake.draw(this);
}
}