Alright, I’ve made my image-morphing algorithm into an extension. Here it is in a quick demo project:
And here is the GitHub repository:
And I implemented it in my latest game, as it seemed to work well with the mechanics I had:
Currently, the extension puts an extra block into the Sprites category, allowing you to morph a sprite’s image into another image. There are a few minor issues:
- The speed works well for 16x16 and even 32x16 sprites, but is kinda slow for larger sprites. I think I have it set at the smallest “pause” possible, 0.01ms, but am not sure.
- I don’t yet know how to cause an error if the two images are different sizes.
- The block does not default to having mySprite filled in, and it must be dragged from Variables.
Let me know if you see any ways I can make it better or possibly useful to others. Perhaps in a future version I’ll add a block that does the reveal in a different pattern, such as spiraling out from the center. Feel free to send a pull request if you want in on this sweet morphing action.
Thanks, and have a great weekend!
P.S. I tried a couple different ways to get the extension working, and the way that was easiest was forking the simple-text repository. I don’t know if that’s kosher, but it got things moving for me. I saw something in GitHub about template repositories, is that an appropriate application, or could we make a more generic extension to fork? Just thinking out loud here.