Skip to content

Commit

Permalink
Adding debug info and fixing weirdly written loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeychernyshev committed Mar 28, 2024
1 parent ddeacf3 commit c2e461f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export const generateMapHTML = function (gameConfig, clusters) {

const tiles = [];

for (let i = clusters.length; i >= 1; i--) {
const blockCoordinates = getMapTileCoordinates(i);
console.log(clusters);

for (let i = 0; i < clusters.length; i++) {
const blockCoordinates = getMapTileCoordinates(i + 1);

const isoX =
(blockCoordinates.x * tileWidth) / 2 - blockCoordinates.y * tileHeight;
Expand All @@ -95,7 +97,7 @@ export const generateMapHTML = function (gameConfig, clusters) {
highestIsoY = isoY;
}

const tileNumber = getTileNumber(clusters[i - 1], numberOfTileVariations);
const tileNumber = getTileNumber(clusters[i], numberOfTileVariations);

tiles.push({ tileNumber, isoX, isoY });
}
Expand Down

0 comments on commit c2e461f

Please sign in to comment.