Finished Moving Steel
parent
63ed2e6165
commit
68c80c2a31
|
@ -149,14 +149,15 @@ public class Player extends GenericSprite {
|
||||||
|
|
||||||
|
|
||||||
for(NonPlayer e: GameFrame.game.enemy){
|
for(NonPlayer e: GameFrame.game.enemy){
|
||||||
System.out.println((xx*Tile.length)+" "+(yy*Tile.length)+" ");
|
int TileX = xx*Tile.length;
|
||||||
System.out.print(" "+ (e.x+GamePanel.GAME_WIDTH/2) + " "+e.y+" ");
|
int TileY = yy*Tile.length;
|
||||||
// if(){
|
int ex = (e.x+GamePanel.GAME_WIDTH/2);
|
||||||
//
|
//System.out.println((xx*Tile.length)+" "+(yy*Tile.length)+" ");
|
||||||
// } else {
|
//System.out.print(" "+ (e.x+GamePanel.GAME_WIDTH/2) + " "+e.y+" ");
|
||||||
// canPlaceSteel = false;
|
if(TileX<=ex+e.WIDTH&&ex<=TileX+Tile.length&&TileY<=e.y+e.HEIGHT&&e.y<=TileY+Tile.length){
|
||||||
// return;
|
canPlaceSteel = false;
|
||||||
// }
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(Math.abs(xDis)<(WIDTH+Tile.length)/2&&Math.abs(yDis)<(HEIGHT+Tile.length)/2){
|
if(Math.abs(xDis)<(WIDTH+Tile.length)/2&&Math.abs(yDis)<(HEIGHT+Tile.length)/2){
|
||||||
canPlaceSteel = false; return;
|
canPlaceSteel = false; return;
|
||||||
|
|
Loading…
Reference in New Issue