Курсовая работа: Гра Змійка опис програми
}
}
public void run (){
while (true){
if (isGameRun && !isGamePause){
keyBlocked = true;
int n = snake.colElements-1;
SnakeElement lastElem = new SnakeElement(snake.elem[n].xPos, snake.elem[n].yPos);
lastElem.setSpeed(snake.elem[n].xSpeed, snake.elem[n].ySpeed);
square[lastElem.xPos][lastElem.yPos].setUsed(false);
square[lastElem.xPos][lastElem.yPos].setBorder(false);
snake.move();
crash = square[snake.elem[0].xPos][snake.elem[0].yPos].isBorder;
target = !crash &&
square[snake.elem[0].xPos][snake.elem[0].yPos].used;
if (target){
snake.increment(lastElem);
createTarget();
cheeckWin();
}
keyBlocked = false;
for (int i = 0; i<snake.colElements; i++){
square[snake.elem[i].xPos][snake.elem[i].yPos].setUsed(true);
square[snake.elem[i].xPos][snake.elem[i].yPos].setBorder(true);
square[snake.elem[i].xPos][snake.elem[i].yPos].n = i;
}
if (crash) { processCrash(); }
repaint();
informPanel.updateInfo(snake.getLives(), snake.colElements,