I believe I'm coding the solution to Part 1 right but it is saying I am not for one of the steps: The Game class's setScreenSize(int, int) method must be called with arguments (WIDTH, HEIGHT) in the initialize() method. What am I doing wrong?
// organize class into package for CodeGym Games Snake
package com.codegym.games.snake;
// import CodeGym Games Snake class
import com.codegym.engine.cell.*;
/*
* This class contain exercise code for the game of Snake from CodeGym.
* The Snake class inherits method intiate from the Game class
*
* author: CodeGym, me
* date: 05.07.20
*/
public class SnakeGame extends Game{
// field variable: public static final int for both WIDTH and HEIGHT set as 15
public static final int WIDTH = 15;
public static final int HEIGHT = 15;
/*
* This is an override method that is inherited from Game class. The override method
* calls on Game's setScreenSize() method to set the setScreenSize
*
* @param width: This is an integer parameter that set the width of the screen
* @param height: This is an integer parameter that set the height of the screen
* @return nothing: This method is void and return nothing
*/
@Override
public void initialize(){
// setting class instance for GAME so WIDTH and HEIGHT can be initialized
Game gameSet = new Game();
// call on Game's setScreenSize to set the width and height of the snake game screen
gameSet.setScreenSize(WIDTH, HEIGHT);
}
}
// organize class into package for CodeGym Games Snake
package com.codegym.games.snake;
// import CodeGym Games Snake class
import com.codegym.engine.cell.*;
/*
* This class contain exercise code for the game of Snake from CodeGym.
* The Snake class inherits method intiate from the Game class
*
* author: CodeGym, me
* date: 05.07.20
*/
public class SnakeGame extends Game{
// field variable: public static final int for both WIDTH and HEIGHT set as 15
public static final int WIDTH = 15;
public static final int HEIGHT = 15;
/*
* This is an override method that is inherited from Game class. The override method
* calls on Game's setScreenSize() method to set the setScreenSize
*
* @param width: This is an integer parameter that set the width of the screen
* @param height: This is an integer parameter that set the height of the screen
* @return nothing: This method is void and return nothing
*/
@Override
public void initialize(){
// setting class instance for GAME so WIDTH and HEIGHT can be initialized
Game gameSet = new Game();
// call on Game's setScreenSize to set the width and height of the snake game screen
gameSet.setScreenSize(WIDTH, HEIGHT);
}
}