Курсовая работа: Гра Змійка опис програми
public void stopGame(){
field.stopGame();
}
}
3.1.3. Файл GameField.java
import java.awt.*;
import javax.swing.*;
import java.util.*;
import java.awt.event.*;
public class GameField extends JPanel
implements Runnable, KeyListener{
Snake snake;
GameFrame frame;
SnakeElement targetElem;
InformPanel informPanel;
protected boolean isGameRun;
protected boolean isGamePause = false;
int gameSpeed = 2;
protected int colObstacles = 12;//Кількість перепон
protected int delay;//Затримка при русі змійки
final int w = 35, h = 25;
protected Thread th;
protected GameSquare square[][];
boolean keyBlocked = false;
boolean crash = false;
boolean target = false;
public GameField(GameFrame owner) {
super();
frame = owner;
this.setLayout(null);