Operations on multiple overlapping layers not working
- by Arun
Hi I am developing a game in android just like Farmville by Zinga. In that game we have to place elements in the diamond shaped field so the don't overlap each other. Now I did coding for placing the field inside the farm field but I cannot stop the problem of overlapping of the farm field. I Am attaching the code that I have down for all this someone please help me....
try{
if(bm1.getPixel((int)initX,(int)initY)!=0){
if(bm1.getPixel((int)initX,(int)initY+20)!=0){
if(bm1.getPixel((int)initX-20,(int)initY)!=0){
if(bm1.getPixel((int)initX+20,(int)initY)!=0){
if(bm1.getPixel((int)initX,(int)initY-20)!=0){
c.drawBitmap(bm,initX-30,initY-20, paint);
}
}
}
}
}
}catch(Exception e) {
Toast.makeText(getContext(), e.toString(), Toast.LENGTH_SHORT);
}