아이소 메트릭 게임을 만들고 있으며 지그재그 아이소 메트릭 맵을 만들었습니다. 내 원래 생각은 다이아몬드 모양 이었지만 그렇게 할 수 없습니다.아이소 메트릭 맵 드로잉, 생성
다이아몬드 : coobird.net/img/tile-diamond-good-order.png
지그재그은 : 는 coobird.net/img/tile-zigzag-compact.png 여기
조금이다
세계 :
public void chunkGenerate() {
moduleX = ((ListManager.getTileWidth()*8));
moduleY = ((ListManager.getTileHeight()*8));
for (int x = 0; x <= width; x++) {
for (int y = 0; y <= height; y++) {
if ((x%moduleX) == 0) {
if ((y%moduleY) == 0) {
chunkList.add(new Chunk(x,y));
}
}
}
}
}
덩어리 :
내 코드의 당신은 무슨 일이 일어나고 있는지 보여3210public void Generate() {
for (int x = 0; x < 8; x++) {
for (int y = 0;y< 8; y++) {
tileList.add(new Tile(location.getX()+(x*ListManager.getTileWidth()),location.getY()+(y*ListManager.getTileHeight()),0));
}
}
}
렌더링 :
for (Chunk c : w.getChunkList()) {
g2d = (Graphics2D) g.create();
for (int i = 0; i<c.getTileList().size(); i+=2) {
g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()+c.getTileList().get(i).getOffset().getxOffset()), (c.getTileList().get(i).getLocation().getY()+c.getTileList().get(i).getOffset().getyOffset()+w.getvOffset()), this);
g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()), (c.getTileList().get(i).getLocation().getY()+w.getvOffset()), this);
}
for (int i = 1;i<c.getTileList().size(); i+=2) {
g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()), (c.getTileList().get(i).getLocation().getY()+w.getvOffset()), this);
g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()+c.getTileList().get(i).getOffset().getxOffset()), (c.getTileList().get(i).getLocation().getY()+c.getTileList().get(i).getOffset().getyOffset()+w.getvOffset()), this);
}
}
내가 대신 지그재그의 다이아몬드로지도를 만들기로 도움이 필요합니다. 코드에 대한 추가 정보가 필요하면 아래에 설명하십시오. 또한이 코드의 버그 중 하나는 타일 몇 개마다 1 픽셀 폭의 공간이 있다는 것입니다. 내가 오프셋을 조정하려하는 이유 .. 내가 .. 도움이되지 않았다, 현재 오프셋을 모르는 : 나는 공백이없는에 도착 (타일 생성자)
offset = new IsometricOffset(21,11);
가장 가까운 20,10했지만 여전히 있었다 도움을
이 http://img845.imageshack.us/img845/6242/picbz.png
감사 : 작은 공간
여기는 그림입니다! 편집 : 화면의 타일 중 2 개가 실제 엔진의 타일 1 개에 불과합니다. 나는 그것을 고치기 위해 노력하고있다.
편집 :
을 변경하고있어이 : img526.imageshack.us/img526/3121/test333.png
도면 :
for (Chunk c : w.getChunkList()) {
/*for (int i = 0; i<c.getTileList().size(); i++) {
g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()), (c.getTileList().get(i).getLocation().getY()+w.getvOffset()), this);
}*/
for (int i = 0;i<c.getTileList().size(); i++) {
g2d.drawImage(test2, (c.getTileList().get(i).getLocation().getX()+c.getTileList().get(i).getOffset().getxOffset()), (c.getTileList().get(i).getLocation().getY()+c.getTileList().get(i).getOffset().getyOffset()+w.getvOffset()), this);
}
}
는 (필자는 오프셋없이 그리기 시도 그것은 그림과 같은 것을 그렸습니다.) 생성 :
for (int x = 0; x < 8; x++) {
for (int y = 0;y< 8; y++) {
tileList.add(new Tile(location.getX()+(x*ListManager.getTileWidth()/2),location.getY()+(y*ListManager.getTileHeight()/2),0));
}
location.setX(location.getX()+ListManager.getTileWidth()/2);
location.setY(location.getY()+ListManager.getTileHeight()/2);
}
실험 후3210
는 :
는는 생성 :
public void Generate() {
for (int x = 0; x < 8; ++x) {
for (int y = 0;y< 8; ++y) {
tileList.add(new Tile(location.getX()+(y*ListManager.getTileWidth()/2),location.getY()-(y*ListManager.getTileHeight()/2),0));
}
location.setX(location.getX()+ListManager.getTileHeight()/2);
location.setY(location.getY()+ListManager.getTileWidth()/2);
}
}
결과 : http://img814.imageshack.us/img814/3450/bombombom.png
당신이 더 많은 정보를 필요로하는 경우 그것은 도움이하지만 난 ... – Trixmix