Last active
April 9, 2017 01:11
-
-
Save jwulf/68281a7290318c85ea2a627489504b71 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const magik = magikcraft.io; | |
/** | |
* @method replay - replay the Magikcraft Camera Path | |
* Yo, this spell written by the Legendary Josh Wulf | |
* Twitter: @sitapati on Twitter | |
* GitHub: https://github.com/jwulf | |
* | |
*/ | |
function replay() { | |
const player = magik.getSender(); | |
if (typeof _path === 'undefined') { | |
magik.dixit('Yo, record something first'); | |
return; | |
} | |
const replayArray = _path.map((point) => { | |
return function() { | |
player.setLocation(point); | |
} | |
}); | |
const frames = replayArray.length; | |
function play(n) { | |
setTimeout(() => { | |
if (n == frames) { | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment