Snake
Snake copied to clipboard
暂停后恢复和重新开始失灵问题及解决
public void run() {
while(running){
if(pause){
continue;
}
repaint();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
continue前加个Thread.sleep(100);可以解决无限卡死问题