Skip to content

Instantly share code, notes, and snippets.

@seleb
Created October 21, 2019 04:28
Show Gist options
  • Select an option

  • Save seleb/d489f0ccfc66cc5939c3feca99a356f9 to your computer and use it in GitHub Desktop.

Select an option

Save seleb/d489f0ccfc66cc5939c3feca99a356f9 to your computer and use it in GitHub Desktop.
bitsy custom exit effect
{
showPlayerStart: true,
showPlayerEnd: true,
duration: 180,
frameRate: 60,
pixelEffectFunc: function (start, end, pixelX, pixelY, delta) {
var a = start.Image.GetPixel(pixelX, pixelY);
var b = end.Image.GetPixel(pixelX, pixelY);
var w = bitsy.tilesize * bitsy.mapsize;
if (pixelY % 2) {
if (pixelX < delta * 2 * w) {
return b;
}
} else {
if (pixelX < (delta - 0.5) * 2 * w) {
return b;
}
}
return a;
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment