@Override
	public void actionPerformed(ActionEvent e) {
		if(firstTime){
			drawRandomNode();
			drawSnake();
			firstTime = false;
		}
		Node last;
		if(e.getSource() == timer){
			last = snake.move(food);
			if(snake.getIsDead()){
				stop();
				System.out.println("snake was dead");
			}else{
				if(snake.eat(food)){
					drawRandomNode();
				}else{
					drawSnake();
					deleteNode(last);
				}
			}
		}
		System.out.println("蛇长：" + snake.size());
	}