Finished Moving Steel
parent
63ed2e6165
commit
68c80c2a31
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue