//canvas.drawRect(20,20,100,100,p);
//canvas.drawColor(Color.RED);
for(int i=0;i<15;i++){
for(int k=0;k<15;k++){
int x=aaa[i][k];
Rect rect = new Rect((mWidth/15)*k,(mWidth/15)*i,(mWidth/15)*(k+1),(mWidth/15)*(i+1));
switch (x){
case 0:
canvas.drawBitmap(bitmap0,null,rect,p);
break;
case 1:
canvas.drawBitmap(bitmap1,null,rect,p);
break;
case 2:
canvas.drawBitmap(bitmap2,null,rect,p);
break;
case 3:
canvas.drawBitmap(bitmap3,null,rect,p);
break;
case 4:
canvas.drawBitmap(bitmap4,null,rect,p);
break;
case 5:
canvas.drawBitmap(bitmap5,null,rect,p);
break;
case 6:
canvas.drawBitmap(bitmap6,null,rect,p);
break;
}
}
}
}
public void setaaa(int [][]xxx){
for(int i=0;i<15;i++){
for(int k=0;k<15;k++) {
aaa[i][k]=xxx[i][k];
}
}
kk=0;
arrayList.clear();
postInvalidate();
}
public void moveLeft(){
addBack();
flag=false;
for(int i=0;i<15;i++){
if (flag){
break;
}
for(int k=0;k<15;k++) {
if (flag){
break;
}
int x = aaa[i][k];
if(x==2|x==6){
Log.e("x",""+x+"i:"+i+"k:"+k);
switch ( aaa[i][k-1]){
case 0://左边是墙,不能移动
break;
case 1://左边是空,可以移动
if(x==6){
aaa[i][k]=5;
}else{
aaa[i][k]=1;