morph image
Problem it solves
You want your player or enemy to power up and transform into a new appearance with a dissolving pixel animation instead of instantly snapping to the new image.
What this block does
Gradually transforms a sprite's current image into a new image by swapping random pixels over time until the full new graphic is visible.
The block
Block ID: spritemorphimage
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| mySprite | Sprite | mySprite | The sprite that will transform into the new image. |
| new_image | Image | The new image the sprite will morph into. |
Example
let mySprite = sprites.create(img`.`, SpriteKind.Player) imagemorph.morph(mySprite, img`.`)
Add the extension
Add github:UnicycleDumpTruck/pxt-image-morph to your project, or open: Import pxt-image-morph.