Place pieces on the board #46

Merged
tonitch merged 4 commits from pieceInteraction into master 2023-05-11 20:09:24 +02:00
Showing only changes of commit 0f1ecc753b - Show all commits

View File

@ -39,6 +39,7 @@ public class Map extends Shape{
if(!pieces.contains(piece))
return false;
piece.setPosition(null);
// In the map limits
if ( pos.x + piece.height > height
|| pos.y+piece.width > width
@ -54,7 +55,6 @@ public class Map extends Shape{
occupation.add(o);
}
}
System.out.println(occupation);
for (int x = pos.x; x < pos.x + piece.height; x++) {
for (int y = pos.y; y < pos.y + piece.width; y++) {
@ -64,7 +64,6 @@ public class Map extends Shape{
}
}
piece.setPosition(pos);
return true;
}