private void createGame() {
setScreenSize(WIDTH, HEIGHT);
drawScene();
}
private void drawScene() {
for (int x = 0; x < WIDTH; x++) {
for (int y = 0; y < HEIGHT; y++) {
setCellColor(WIDTH, HEIGHT, Color.DARKSEAGREEN);
}
}
}
package com.javarush.games.snake;
import com.javarush.engine.cell.*;
public class SnakeGame extends Game {
public static final int WIDTH = 15;
public static final int HEIGHT = 15;
public void initialize() {
setScreenSize(WIDTH, HEIGHT);
getScreenWidth();
getScreenHeight();
createGame();
}
}
private void createGame() {
setScreenSize(WIDTH, HEIGHT);
drawScene();
}
private void drawScene() {
for (int x = 0; x < WIDTH; x++) {
for (int y = 0; y < HEIGHT; y++) {
setCellColor(WIDTH, HEIGHT, Color.DARKSEAGREEN);
}
}
}
}