Skip to content

Instantly share code, notes, and snippets.

@Core-commits
Last active July 25, 2020 13:52
Show Gist options
  • Save Core-commits/11da7feb4ec9d43cba448dbfda2c27a6 to your computer and use it in GitHub Desktop.
Save Core-commits/11da7feb4ec9d43cba448dbfda2c27a6 to your computer and use it in GitHub Desktop.
BrickRotation
function rotateBrick(name, increment, rot)
world.bricks.forEach(async(brick) => { // Finds all brick possible in the map.
if (brick.name == "car") {
brickRot= brick.rotation
setInterval(function () {
for (brickRot <= rot; brickRot + increment;) {
console.log(brick.rotation)
}
}, interval);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment