Finished Moving Steel

master
bob 2022-06-17 13:28:39 -04:00
parent 63ed2e6165
commit 68c80c2a31
1 changed files with 9 additions and 8 deletions

View File

@ -149,14 +149,15 @@ public class Player extends GenericSprite {
for(NonPlayer e: GameFrame.game.enemy){
System.out.println((xx*Tile.length)+" "+(yy*Tile.length)+" ");
System.out.print(" "+ (e.x+GamePanel.GAME_WIDTH/2) + " "+e.y+" ");
// if(){
//
// } else {
// canPlaceSteel = false;
// return;
// }
int TileX = xx*Tile.length;
int TileY = yy*Tile.length;
int ex = (e.x+GamePanel.GAME_WIDTH/2);
//System.out.println((xx*Tile.length)+" "+(yy*Tile.length)+" ");
//System.out.print(" "+ (e.x+GamePanel.GAME_WIDTH/2) + " "+e.y+" ");
if(TileX<=ex+e.WIDTH&&ex<=TileX+Tile.length&&TileY<=e.y+e.HEIGHT&&e.y<=TileY+Tile.length){
canPlaceSteel = false;
return;
}
}
if(Math.abs(xDis)<(WIDTH+Tile.length)/2&&Math.abs(yDis)<(HEIGHT+Tile.length)/2){
canPlaceSteel = false; return;