I know I need to initialise the snake and game variables in the main method... fairly sure.
With the snake I'm not sure how to pass the x and y variables it needs to be initialised.
I've tried using the getSnake() method. Tried passing my own arbitrary x and y ints.
With the game.. I gather I'm not passing that requirement because the snake hasn't been created properly, which then flows onto the SnakeDirection task as well.
package com.codegym.task.task23.task2312;
public class Room {
private int width;
private int height;
private Snake snake;
private Mouse mouse;
public static Room game;
public static void main(String[] args) {
Snake snake = new Snake(game.getSnake().getX(), game.getSnake().getY());
game = new Room(game.getWidth(), game.getHeight(), snake);
snake.setDirection(SnakeDirection.DOWN);
}
public Room(int width, int height, Snake snake) {
this.width = width;
this.height = height;
this.snake = snake;
}
public void run() {}
public void print() {}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public Snake getSnake() {
return snake;
}
public void setSnake(Snake snake) {
this.snake = snake;
}
public Mouse getMouse() {
return mouse;
}
public void setMouse(Mouse mouse) {
this.mouse = mouse;
}
}