Skip to content

Instantly share code, notes, and snippets.

@jwulf
Last active April 9, 2017 01:11
Show Gist options
  • Save jwulf/68281a7290318c85ea2a627489504b71 to your computer and use it in GitHub Desktop.
Save jwulf/68281a7290318c85ea2a627489504b71 to your computer and use it in GitHub Desktop.
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