Browse Source

update

main
Justin Senn 2 years ago
parent
commit
8b0beb2cc3
  1. 19
      src/main/java/Snake/Game.java

19
src/main/java/Snake/Game.java

@ -1,5 +1,24 @@
package Snake;
public class Game {
public Game() {
final int VIEW_SIZE = 100;
final int GRID_SIZE = 10;
final int CELL_SIZE = VIEW_SIZE / GRID_SIZE;
Window gameWindow = new Window(VIEW_SIZE, GRID_SIZE);
Snake snakeModel = new Snake(GRID_SIZE);
SnakeView snakeView = new SnakeView(CELL_SIZE);
Apple appleModel = new Apple();
AppleView appleView = new AppleView(CELL_SIZE);
GameView gameView = gameWindow.getGameView();
gameView.addView(snakeView);
gameView.addView(appleView);
new Controller(gameWindow, snakeModel, snakeView, appleModel, appleView);
}
}
Loading…
Cancel
Save