Skip to content

Commit

Permalink
#25 - Fixed algorithm for diagonal path
Browse files Browse the repository at this point in the history
  • Loading branch information
codenameyau committed Sep 7, 2015
1 parent 1c88e5b commit bdd5a5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/tyrian-city/generator/street.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class StreetGenerator {
// Branch path based on start and end positions.
let verticalPath = (x2 - x1) === 0;
let horizontalPath = (y2 - y1) === 0;
let diagonalPath = (x2 > x1 && y2 > y1);
let diagonalPath = (x1 === y1 && x2 === y2);

if (verticalPath) {
for (let y=y1; y<=y2; y++) {
Expand Down

0 comments on commit bdd5a5c

Please sign in to comment.