Would anyone happen to have advice on how to distort a small selection of pixels onscreen (For instance, an arbitrary 8x8 square)? I'm trying to add an effect where if the player bumps into a solid platform, that piece of the platform bends up with an effect similar to the arcade Mario Bros. game. I tried following the tutorial on wave distortions from PicoZine #2 but that seems to be based on distorting all tiles of a certain type on screen.
TL;DR, are there any tutorials you'd recommend for distortion effects?
There are a lot of ways to do it. You could:
- Animate the tile using sprites
- Use sspr or primitives (rect, etc) to draw the tile a few pixels at a time and offset where they are drawn based on a timer... if you multiply that offset by how far the pixels are from the center of the tile, it would make a 'wave' effect
Thanks!!! Sorry for not being more clear but my main issue is that I'd like to be able to do the effect on the pixels directly. For instance, if the player hits directly between two tiles, I'd like the "bump" to appear centered at the point of impact, rather than one of the two tiles.
[Please log in to post a comment]