Skip to content

Instantly share code, notes, and snippets.

@Jorger
Created September 11, 2018 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jorger/58a966e4feb651d96bbe6d38f07e2d5e to your computer and use it in GitHub Desktop.
Save Jorger/58a966e4feb651d96bbe6d38f07e2d5e to your computer and use it in GitHub Desktop.
if (dataPipe[3] !== dataPipe[5]) {
const indexRotate = pipesRotate.map(v => v[0]).indexOf(index);
if (indexRotate >= 0) {
const newAngule = angles[dataPipe[5]] === 0 ? 360 : angles[dataPipe[5]];
if (pipesRotate[indexRotate][1] + 15 <= newAngule) {
pipesRotate[indexRotate][1] += 15;
angle = pipesRotate[indexRotate][1];
} else {
angle = newAngule;
pipesRotate.splice(indexRotate, 1);
actualWorld[1][index][3] = dataPipe[5];
//Revisará las conexiones...
checkConectionPipe();
}
}
}
//Realizar giro...
ctx.rotate((angle * Math.PI) / 180);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment