我基本上写了一个布尔数组[x] [y],x,y是坐标,如果它的确存在一个炸弹。getter为一个布尔数组[] []
林具有与该吸气麻烦,
我到目前为止
boolean[][] bombArray = new boolean[Total_Columns][10];
for(x=0,x<Total_Colmns,x++){
bombArray[x][0] = true;
}
public boolean getBombArray(int x,int y){
if(bombArray[x][y] .equals(true){
return true;
}
else{
return false;
}
}
我的主要看起来像这样
main()
boolean isBomb = myPanel.getBombArray(x,y) //x and y being the cursor coordinates
if(isBomb){
....
....
....
....
{
else{
....
....
....
}
基本上电网将是这样
********* ......... ......... ......... ......... ......... ......... ......... .........
可是我得到的是不工作的,它不断抛出异常
有什么例外? – AsemRadhwi
请注意:没有理由使用getBombArray中的条件,只需返回该位置的值:'return bombArray [x] [y];' –