Курсовая работа: Гра Змійка опис програми
if (isGameRun) stopGame();
setDefault();
snake.resetLives();
isGameRun = true;
isGamePause = false;
}
public void pauseGame(){
isGamePause = !isGamePause;
if (isGamePause){
keyBlocked = true;
repaint();
} else{
keyBlocked = false;
}
}
public void stopGame( ){
isGameRun = false;
repaint();
}
public void setGameSpeed(int s){
gameSpeed = s;
switch (gameSpeed){
case 1: delay = 400; break;
case 2: delay = 200; break;
case 3: delay = 100; break;
}
informPanel.updateInfo(snake.getLives(), snake.colElements,
gameSpeed, colObstacles);
}