标签:down ram cal 课程设计 ack ace mat lis form
1.负责实现闯关模式
2.负责实现挑战模式
3.串联GUI与信息代码
4.实现排行榜功能



this.thread = new Thread(() -> { while (start) { if (count == 0) { break; } if (!pause) { count--; initText(); } try { Thread.sleep(SECOND); } catch (InterruptedException e) { e.printStackTrace(); } } count = 0; });
public void paint(Graphics g) {
clearDraw(g);
if(ground != null&&snake!=null&&food!=null) {
ground.drawMe(g);
food.drawMe(g);
snake.drawMe(g);
}
if(snake!=null&& !snake.isLife()) {
recover(g);
}
}

public void newGame() {
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
}
ground.clear();
ground.generateRocks();
food.newFood(ground.getPoint());
buttonPanel.getMapLevLabel().setText("");
buttonPanel.getMapLevLabel().setText(""+ground.getMapType());
snake.setSleepTime(100);
buttonPanel.setScore(0);
buttonPanel.repaint();
}
public void calculate() {
String s ="您的成绩为:最终关卡:"+ground.getMapType()+" 最终得分"+snake.getFoodCount();
SkipFrame2 skipFrame = new SkipFrame2();
skipFrame.getLabel().setBounds(100,50,600,40);
int flag=information.compare1(ground.getMapType(), snake.getFoodCount());
skipFrame.getLabel().setText(s);
if(flag>0) {
skipFrame.successful();
skipFrame.visible();
skipFrame.getButton().addActionListener(e -> {
String name=skipFrame.getNameText().getText();
skipFrame.shutdown();
information.addList1(flag, name, ground.getMapType(), snake.getFoodCount());
});
}else {
skipFrame.visible();
skipFrame.getButton().addActionListener(e -> skipFrame.shutdown());
}
}


经过这次的课程设计,让我对多线程以及面向对象编程有了更加深刻的理解,并且感受到了团队合作的重要性,Java通常是要团队分工进行的,所以一些命名的规范,接口之类的就变得非常重要了,此次课程设计也让我对java编程有了更深一层的掌握,并且对游戏的创作有了一点了解。
标签:down ram cal 课程设计 ack ace mat lis form
原文地址:https://www.cnblogs.com/crc01/p/12169274.html