|
|
|
@ -29,7 +29,7 @@ public class Game extends JFrame {
|
|
|
|
|
MapUtil.compareAll(map);
|
|
|
|
|
|
|
|
|
|
//添加背景
|
|
|
|
|
addBackgound();
|
|
|
|
|
addBackgound(gameMode);
|
|
|
|
|
|
|
|
|
|
aotoRefresh();//自动刷新
|
|
|
|
|
}
|
|
|
|
@ -63,10 +63,25 @@ public class Game extends JFrame {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void addBackgound(){
|
|
|
|
|
JLabel backgroungLabel = new JLabel(new ImageIcon("imgs/背景1.png"));
|
|
|
|
|
backgroungLabel.setBounds(0,0,450,800);
|
|
|
|
|
this.add(backgroungLabel);
|
|
|
|
|
private void addBackgound(int gameMode){
|
|
|
|
|
JLabel backgroungLabel;
|
|
|
|
|
switch(gameMode){
|
|
|
|
|
case 1:
|
|
|
|
|
backgroungLabel = new JLabel(new ImageIcon("imgs/背景1_1.png"));
|
|
|
|
|
backgroungLabel.setBounds(0,0,450,800);
|
|
|
|
|
this.add(backgroungLabel);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
backgroungLabel = new JLabel(new ImageIcon("imgs/背景2_1.png"));
|
|
|
|
|
backgroungLabel.setBounds(0,0,450,800);
|
|
|
|
|
this.add(backgroungLabel);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
backgroungLabel = new JLabel(new ImageIcon("imgs/背景3_1.png"));
|
|
|
|
|
backgroungLabel.setBounds(0,0,450,800);
|
|
|
|
|
this.add(backgroungLabel);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void aotoRefresh(){
|
|
|
|
|