| 47 | private JLabel[][] uis = new JLabel[12][16]; |
| 48 | |
| 49 | private void dateUI() { |
| 50 | // ǽ��ʼ�� |
| 51 | for (int i = 0; i < dates.length; i++) { |
| 52 | for (int j = 0; j < dates[i].length; j++) { |
| 53 | if (dates[i][j] == 1) { |
| 54 | JLabel temp = new JLabel(new ImageIcon("1.png")); |
| 55 | temp.setBounds(10 + j * 50, 10 + i * 50, 50, 50); |
| 56 | this.panel.add(temp); |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | // �����ʼλ�õ�3�У���3��(���ڵ�0�е�0��) |
| 61 | this.playerX = 3; |
| 62 | this.playerY = 3; |
| 63 | player = new JLabel(new ImageIcon("-10.png")); |
| 64 | player.setBounds(10 + playerX * 50, 10 + playerY * 50, 50, 50); |
| 65 | this.panel.add(player); |
| 66 | |
| 67 | // Ŀ���ʼ�� |
| 68 | // ��total�й� |
| 69 | JLabel tar1 = new JLabel(new ImageIcon("8.png")); |
| 70 | tar1.setBounds(10 + 14 * 50, 10 + 5 * 50, 50, 50); |
| 71 | this.panel.add(tar1); |
| 72 | dates[5][14] = LogicHelper.TARGET; |
| 73 | uis[5][14] = tar1; |
| 74 | JLabel tar2 = new JLabel(new ImageIcon("8.png")); |
| 75 | tar2.setBounds(10 + 14 * 50, 10 + 6 * 50, 50, 50); |
| 76 | this.panel.add(tar2); |
| 77 | dates[6][14] = LogicHelper.TARGET; |
| 78 | uis[6][14] = tar2; |
| 79 | JLabel tar3 = new JLabel(new ImageIcon("8.png")); |
| 80 | tar3.setBounds(10 + 14 * 50, 10 + 7 * 50, 50, 50); |
| 81 | this.panel.add(tar3); |
| 82 | dates[7][14] = LogicHelper.TARGET; |
| 83 | uis[7][14] = tar3; |
| 84 | |
| 85 | // ���ӳ�ʼ�� |
| 86 | // ��total�й� |
| 87 | JLabel box1 = new JLabel(new ImageIcon("4.png")); |
| 88 | box1.setBounds(10 + 7 * 50, 10 + 3 * 50, 50, 50); |
| 89 | this.panel.add(box1); |
| 90 | dates[3][7] = LogicHelper.BOX; |
| 91 | uis[3][7] = box1; |
| 92 | JLabel box2 = new JLabel(new ImageIcon("4.png")); |
| 93 | box2.setBounds(10 + 7 * 50, 10 + 5 * 50, 50, 50); |
| 94 | this.panel.add(box2); |
| 95 | dates[5][7] = LogicHelper.BOX; |
| 96 | uis[5][7] = box2; |
| 97 | JLabel box3 = new JLabel(new ImageIcon("4.png")); |
| 98 | box3.setBounds(10 + 7 * 50, 10 + 7 * 50, 50, 50); |
| 99 | this.panel.add(box3); |
| 100 | dates[7][7] = LogicHelper.BOX; |
| 101 | uis[7][7] = box3; |
| 102 | |
| 103 | } |
| 104 | |
| 105 | private int[][] dates = new int[12][16]; |
| 106 | |