Only other question on this task seems to have the same problem with no answer.
Please can someone help
package com.codegym.task.task23.task2312;
public class Room {
private int width;
private int height;
private static Snake snake;
private Mouse mouse;
static Room game;
public static void main(String[] args){
Snake snake1 = new Snake(5,5);
game = new Room(10, 10, snake1);
game.snake.setDirection(SnakeDirection.DOWN);
game.createMouse();
game.run();
}
public Room(int width, int height, Snake snake){
this.width = width;
this.height = height;
this.snake = snake;
}
void run(){}
void sleep(){}
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;
}
public void createMouse(){
int x = (int) (Math.random() * width);
int y = (int) (Math.random() * height);
mouse = new Mouse(x, y);
}
public void eatMouse(){
createMouse();
}
}