исправил перемещение
This commit is contained in:
parent
e822561eec
commit
c7d2376962
@ -33,7 +33,7 @@ public abstract class AbstractMap {
|
||||
{
|
||||
for (int j = (int)(position[0] / _size_x); j <= (int)(position[1] / _size_x); ++j)
|
||||
{
|
||||
if (_map[i][j] == _barrier) return false;
|
||||
if (i >= 0 && j >= 0 && i < _map.length && j < _map[0].length && _map[i][j] == _barrier) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -125,6 +125,6 @@ public class DrawingShip extends JPanel {
|
||||
}
|
||||
|
||||
public float[] GetCurrentPosition() {
|
||||
return new float[]{_startPosX, _startPosY, _startPosX + _warmlyShipWidth, _startPosY + _warmlyShipHeight};
|
||||
return new float[]{_startPosX, _startPosX + _warmlyShipWidth, _startPosY, _startPosY + _warmlyShipHeight};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user