Делал дома через IDEA, потом открыл в браузере и увидел, что файлы повторяются (притом новые файлы не мои)
package com.javarush.task.task23.task2312;
/**
* Created by mymac on 09.10.17.
*/
public class Room {
private int width;
private int height;
private Mouse mouse;
private Snake snake;
public static Room game;
public Room(int width, int height, Snake snake) {
this.width = width;
this.height = height;
this.snake = snake;
}
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 Mouse getMouse() {
return mouse;
}
public void setMouse(Mouse mouse) {
this.mouse = mouse;
}
public Snake getSnake() {
return snake;
}
public void setSnake(Snake snake) {
this.snake = snake;
}
public void run()
{
}
public void print(){
}
public void createMouse(){
int x = (int) (Math.random() * width);
int y = (int) (Math.random() * height);
Mouse ms = new Mouse(x,y);
this.mouse = ms;
}
public void eatMouse(){
createMouse();
}
public void sleep()
{
}
public static void main(String[] args){
Snake snake = new Snake(3,4);
snake.setDirection(SnakeDirection.DOWN);
Room rm = new Room (200,200,snake);
game = rm;
game.createMouse();
game.run();
}
}