버그 클래스 앞에있는 두 공백이 아무 것도없는 명확한 지점인지 확인하고 경계를 넘지 않는지 어떻게 확인합니까? 지금 당장 가지고있는 것입니다.그리드 월드에서 위치 확인
public void act()
{
if(canMove())
{
Location loc = getLocation();
Location nextLocation = loc.getAdjacentLocation(getDirection());
nextLocation = nextLocation.getAdjacentLocation(getDirection());
if (nextLocation == null)
{
move();
move();
}
}
}
버그가 없으므로 작동하지 않는 것 같습니다.
,하지만 난 그것이 경계 그리드를 유지하기 위해 어떻게받을 수 있나요? – Hulu